We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Flatten PDF

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”);




Hi Adam,


Thanks for your inquiry. Please share your sample document here, so we will test the scenario at our end and will guide you accordingly.

We are sorry for the inconvenience caused.

Best Regards,

Thanks. I have attached the pdf file that I am using to fill in the form values with. I also checked and the version of adobe reader that I am using on my machine is version 10.1.9. The pdf I attached was created with version 11.0.04 of adobe.

Hi Adam,


I have tested the scenario using Aspose.Pdf for .NET 8.8.0 where I have used the code snippet shared in your first post and I am unable to notice the problem. The PDF document is properly appearing in Adobe Reader 11.0.2. For your reference, I have also attached the resultant PDF generated over my end.

Hi I tried my code on another computer and I’m stilling having the same problem.

I included my visual studio solution and the pdf that generates the error when the student name field is clicked. I removed the nuget package for Aspose pdf because it made the zip file to big. If you recreate the directory structure I have and add the nuget package for Aspose pdf from the visual studio package manager then you should have my same environment.

The new computer that I tried it on has adobe pdf reader 11.

Thanks for the help.

Hi Adam,


Thanks for sharing the resource files.

I have tested the scenario and I am able to
notice the same problem that when using the component in trial mode, an error message appears when viewing the document. However when using the component in licensed mode, no such error occurs. For the sake of correction, I have logged this problem
as PDFNEWNET-36323 in our issue tracking system. We will further
look into the details of this problem and will keep you updated on the status
of correction. Please be patient and spare us little time. We are sorry for
this inconvenience.

Thanks for the help. Unfortunately our deadline is coming up for our project and we will be releasing on the first or second week of February. If the bug is fixed before then I will give it a try again.


Thanks

Hi Adam,

In order to resolve the issue, you may consider requesting a 30 days temporary license because this problem does not appear when using the API in licensed mode. Please visit the following link for further details on Get a temporary license.

Thanks Nayyer


I just tried the temporary license and it works perfectly in licensed mode.

Thanks for all the help.

Hi Adam,

I am glad to hear that your problem is resolved with Temporary license. Please continue using our API and in case of any further query, please feel free to contact.

The issues you have found earlier (filed as PDFNEWNET-36323) have been fixed in Aspose.Pdf for .NET 9.2.0.

The blog post for this release is created over this link


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.