Page 1 of 1

Flattening PDF documents.

Posted: Tue May 25, 2021 1:09 am
by IntegraHarlan
HI,
Other PDF API's that I have worked with have flatten features to flatten the document, annotations, and form fields.
I do not see any flatten methods in the VintaSoft API. Is there a way to perform the flatten functionality in VintaSoft?

Thanks
Harlan

Re: Flattening PDF documents.

Posted: Tue May 25, 2021 8:55 am
by Alex
Hi Harlan,

If you want to flatten PDF document, please use the Vintasoft.Imaging.Pdf.Processing.PdfSimplifyContentCommand class.

Best regards, Alexander

Re: Flattening PDF documents.

Posted: Tue May 25, 2021 8:52 pm
by IntegraHarlan
Thank you for your quick reply.
I have a couple questions about using the PdfSimplifyContentCommand.
1. I see how to apply the command to documents and pages, but is there a way to apply the command to just annotations, or just FormFields?
2 Also, I am unsure what properties to set to flatten the document, pages, annotations, or form fields. Can you provide information on what properties to set to flatten these items?

Thanks
Harlan

Re: Flattening PDF documents.

Posted: Sat May 29, 2021 1:52 am
by IntegraHarlan
Hi,
I was able to play with flattening and get some things figured out. I still have some questions.
I would like to flatten most of the annotations, but would like to exclude some annotation types. Specifically the Link annotations. I would like the Link annotations to not be flattened if possible.
Also, When I flatten a document, some items in the page BasicOpject are removed on flatten. Is there a way I can retain all of the items in the page BasicObject property when I flatten a document?

Thanks

Re: Flattening PDF documents.

Posted: Tue Jun 01, 2021 9:00 am
by Alex
Hi Harlan,

Sorry for delay.


I would like to flatten most of the annotations, but would like to exclude some annotation types. Specifically the Link annotations. I would like the Link annotations to not be flattened if possible.
If you want to flatten annotation only, you do not need to use the Vintasoft.Imaging.Pdf.Processing.PdfSimplifyContentCommand class.

For flatten annotations on PDF page you need to do the following steps:
Also, When I flatten a document, some items in the page BasicObject are removed on flatten. Is there a way I can retain all of the items in the page BasicObject property when I flatten a document?
I am not sure I have understood this problem. Please send me more info.

Best regards, Alexander

Re: Flattening PDF documents.

Posted: Tue Jun 01, 2021 11:29 am
by Alex
Please see how to flatten annotations in PDF document here: https://www.vintasoft.com/forums/viewto ... 9952#p9952

Please see how to flatten form fields in PDF document here: https://www.vintasoft.com/forums/viewto ... =23&t=5861

Best regards, Alexander

Re: Flattening PDF documents.

Posted: Tue Jun 01, 2021 6:48 pm
by IntegraHarlan
Thank you for your reply.
I will try your suggestion for flatting annotations.
I suspect that this method will fix the issue with the page BasicObject items being removed. I will let you know if I still have problems with that.

Thanks again.