Flatten PDF - looses images

Hi
I’m trying to flatten a PDF. But the saved PDF does not contain the images , contained in the original.
Any idea what is wrong?

        // Open document
        Document doc = new Document("C:\\Before.pdf");

        doc.Form.Type = Aspose.Pdf.Forms.FormType.Standard;

        doc.Save("C:\\After.pdf.PDF");

@jon_elster_i3intel_com

Would you please share your sample PDF file with us as well. We will test the scenario in our environment and address it accordingly.

How do I share a file privately?

@jon_elster_i3intel_com

You can please share it in a private message by clicking over username and pressing the Blue Message button.

I don’t understand… here it is!!!

image001.png (9.73 KB)

MFO-2105 RUATAN ST1-Before.pdf (4.74 MB)

@jon_elster_i3intel_com

In your original post, you mentioned that you were trying to flatten the PDF document. We used the below code snippet for flattening and did not notice any issue as images were intact in the output document:

var doc = new Document(dataDir + "MFO-2105 RUATAN ST1-Before.pdf");
doc.Flatten();
doc.Save(dataDir + "Flattened.pdf");

Flattened.pdf (4.7 MB)

On the other hand, we did notice that the image was absent when converted dynamic XFA to Standard AcroForms. So, an issue as PDFNET-49682 has been logged in our issue tracking system for the sake of correction. We will look into its details and let you know as soon as it is rectified. Please be patient and give us some time.

We are sorry for the inconvenience.

Doesn’t work… I get the following. Any ideas? Thx

**Please wait… **


**If this message is not eventually replaced by the proper contents of the document, your PDF **
**viewer may not be able to display this type of document. **


**You can upgrade to the latest version of Adobe Reader for Windows®, Mac, or Linux® by **
**visiting http://www.adobe.com/go/reader_download. **


**For more assistance with Adobe Reader visit http://www.adobe.com/go/acrreader. **


**Windows is either a registered trademark or a trademark of Microsoft Corporation in the United States and/or other countries. Mac is a trademark **
of Apple Inc., registered in the United States and other countries. Linux is the registered trademark of Linus Torvalds in the U.S. and other

@jon_elster_i3intel_com

Could you please share in which viewer you viewed the file shared by us? Are you using Adobe Reader? Please share the screenshot of error along with version details of the Adobe Reader.

I opened the flatten file in Chrome and got

Please wait… **

**If this message is not eventually replaced by the proper contents of the document, your PDF **
**viewer may not be able to display this type of document. **

**You can upgrade to the latest version of Adobe Reader for Windows®, Mac, or Linux® by **
**visiting http://www.adobe.com/go/reader_download. **

[I will be notified once PDFNET-49682 is resolved?
thx

@jon_elster_i3intel_com

Please try to use Adobe Reader in order to view the file as API mimics the behavior of Adobe Acrobat Reader. In case you face any issue while opening the file in it, please let us know.

Yes, you will definitely be notified once the issue is resolved.

Hi
Any updates on PDFNET-49682 ?
thx

@jon_elster_i3intel_com

I regret to share that the issue has been added recently and is in waiting queue at the moment. We request for your patience and will share the feedback with you as soon as it will be shared.

Hi… Any updates on PDFNET-49682 ??? We need this fix ASAP. Thx

@jon_elster_i3intel_com

We regret to share that the earlier logged issue is not yet resolved. Please note that it was recently logged in free support model and will be investigated and resolved on a first come first serve basis. We will surely inform you a soon as we make some definite progress towards its resolution. Please be patient and spare us some time.

We are sorry for the inconvenience.

The issues you have found earlier (filed as PDFNET-49682) have been fixed in Aspose.PDF for .NET 21.6.

Awesome! Finally!

1 Like