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

Free Support Forum - aspose.com

BUG: Error in PDF after Form.FlattenAllFields

I have a PDF form. I am using FillField to input data into the fields. I want to then flatten the fields, so the values are part of the PDF, and no longer in a form.

The process runs, and it creates my new PDF, but when I open the PDF i get the following error:

An error exists on this page. Acrobat may not display the page correctly.

My forms fields are gone, as well as my values.

Here is the code I am using for this:

FileStream stream = new FileStream("D:\\Project\\PDFProofofConcept\\PDFProofofConcept\\testing.pdf", FileMode.Open);

Form form = new Form(stream);

form.FillField("Your Name", "My Name");
form.FillField("Your Title", "Software Developer");


form.DestFileName = "D:\\Project\\PDFProofofConcept\\PDFProofofConcept\\MyTest.pdf";

I am using this as a proof of concept for us to purchase this within the next couple of days, so a resolution to this would be great, so we can make a purchase.
I have attached the original file, and the second file.

Hello David,

Thanks for your interest in our products.

I have tested the scenario using Aspose.Pdf for .NET 6.0.0 and I am unable to notice any problem. The resultant PDF properly contains the information inside form fields. For your reference, I have also attached the resultant PDF that I have generated. Can you please try using v6.0.0 and in case you still face any problem, please share some details regarding your working environment and Adobe Acrobat version that you are using to view the PDF document.

We are sorry for your inconvenience.

I am using version 6.0.0. Some more information about my environment is. I am using visual studio 2010. Windows 7 64bit. I am using Adobe Reader X to view the result PDF. I created it using Adobe Acrobat X also. If I don’t flatten the fields, the data fills in, but I only see it if I select the form field. When I flatten the fields, then I get the error.

Hello David,

I have further investigated this problem and have observed that when I have tried to open the source PDF form in VisualStudio 2010 Ultimate solution over Windows 7 Professional 64Bit, I am getting ArgumentNullException error message. For the sake of correction, I have logged it as PDFNEWNET-29150 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.

However when I have executed the same code snippet in VisualStudio 2008 professional project over Windows 7 Professional 64Bit, form fields are being flatten and resultant document is properly being generated. I am viewing the resultant PDF document in Adobe Reader X (10.0.1) and form fields seem to be properly flattened. I am again attaching the resultant PDF that I have generated using VisualStudio 2008 solution. Can you please try viewing the attached PDF document in your environment and see if you can notice any problem ?

We are really sorry for this inconvenience.

I can view both just fine. My problem, is that I cant run this in Visual Studio 2008. All of our projects are in Visual Studio 2010 Professional. Also, When it flattens, does it always flatten with the white background like your PDF's show? I also just for a test ran this in Visual Studio 2008, and I get the same error after I flatten the pdf.

I also opened the resultant PDF in Reader 8.1, and I get a different error:

Could not find the XObject named 'FRM0'


Thanks for sharing the information.

I have again tested the scenario using VisualStudio 2005 and I am still unable to notice any problem. I have used the product release shared over this link. I am still unable to see the problem while viewing the update PDF document in Adobe Reader 7.0.0. We are sorry for your inconvenience.

In order to set the Field background color, you may try using the BackgroundColor property of FormFieldFacade class.


Aspose.Pdf.Facades.FormFieldFacade facade = new Aspose.Pdf.Facades.FormFieldFacade();
facade.BackgroundColor = System.Drawing.Color.Transparent;
Aspose.Pdf.Facades.FormEditor editor = new Aspose.Pdf.Facades.FormEditor("d:/pdftest/DataUpdate-Testing.pdf", "d:/pdftest/FieldColor_Updated.pdf");
editor.Facade = facade;

The issues you have found earlier (filed as 29150) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.