Hi Guys,
I’ve been following the Preserve Extended Rights article and have developed the following code:
var fs = new FileStream(“W8BEN.pdf”, FileMode.Open, FileAccess.ReadWrite);
var pdfDocument = new Document(fs);
//get values from all fields
foreach (Field formField in pdfDocument.Form)
{
// if the fullname of field contains A1, perform the operation
if (formField.FullName.Contains(“f1-1”))
{
// Cast form field as TextBox
TextBoxField textBoxField = formField as TextBoxField;
// modify field value
textBoxField.Value = “Testing”;
}
}
// flatten form
pdfDocument.Form.Flatten();
// save the doc
pdfDocument.Save();
// close the File Stream object
fs.Close();
Once I’ve filled in the form I want to flatten the document so that it cannot be edited electronically and must be printed first. To that end I am calling pdfDocument.Form.Flatten().
When opening the resulting PDF I receive the message “This document enabled extended features in Adobe Reader. The document has been changed since it was created and use of extended features is no longer available. Please contact Author”
How do I flatten the fields and remove this message. If I do not flatten the fields I do not get the warning (but that leaves the fields enabled which is not the desired output)
Many thanks,
James