Hi
We are testing several solutions to fill out a PDF form. At the moment I am having trouble flattening a form so that it cannot be edited. After editing a field and then flattening the form the field is blank. The fields with default values are however flattened correctly. The pdf also generates a error. It states: "An error exists on this page" The PDF was created with adobe version 11. I am using Aspose version 8 that I added to my project using nuget.
I also tried to flatten the form using ITextShap and did not have any trouble flattening the file.
I tried both
doc.Fatten();
and
doc.Form.Flatten();
Here is the code I am using.
var pdfDocument = new Document(@"c:\PdfForm\Test_Certificate_usl.pdf");
var textBoxField = (pdfDocument.Form["StudentName"] as TextBoxField);
textBoxField.Value = "John Smith";
pdfDocument.Flatten();
pdfDocument.Save(@"c:\PdfForm\aspose.pdf");