Skip to main content
Netforward16202187
Participant
December 1, 2016
Question

Export a pdf file as a flat pdf file by using javascript

  • December 1, 2016
  • 3 replies
  • 1839 views

I want to Export a pdf file as a flat pdf file by using JavaScript. Do you have an idea how this can be solved? Let me know, if you have different ideas or methods,

This topic has been closed for replies.

3 replies

Netforward16202187
Participant
December 2, 2016

Thank you guys for your feedback. The flatten function is running. Great. Can you give me a tip how can I save the pdf file under a different path and different Name? My idea is to use it in the same JavaScript after the flatten function.

Inspiring
December 2, 2016

See How to Save a PDF with Acrobat JavaScript by Thom Parker. Be sure to read through the comments.

Netforward16202187
Participant
December 4, 2016

Dear gkaiseril,

Thank you very much for your answer. I don't have so much experiences in using JavaScript. In read the article and all the comments for different times now. I always got the security message. What is the easiest way to save the pdf file? What is necessary to run the SaveAs command. I tried to put into the "app.priv" Parameters but it didn't work. Do you have more Information or an example?

Thank you very much. Regards,

Thorsten

Inspiring
December 1, 2016

As noted you can flatten the PDF using JavaScript. One can then save the flattened file or use the "Export to" to create a file of the PDF in a different format.

try67
Community Expert
Community Expert
December 1, 2016

You can flatten all form fields and comments in a file by using the flattenPages method, like this:

this.flattenPages();