Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

New Here ,
Dec 01, 2016 Dec 01, 2016

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,

TOPICS
Acrobat SDK and JavaScript , Windows
1.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 01, 2016 Dec 01, 2016

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

this.flattenPages();

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 01, 2016 Dec 01, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 02, 2016 Dec 02, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 02, 2016 Dec 02, 2016

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 04, 2016 Dec 04, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 04, 2016 Dec 04, 2016
LATEST

Dear gkaiseril,

I found a solution. I created a folder level script and added the saveAs function. The function of the folder level script is used now in the action script of the button. Everything works fine now.

Thanks again for your help.

Regards and have a nice day.

Thorsten

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines