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

Cmd to save PDF document to a specific folder

New Here ,
Nov 12, 2021 Nov 12, 2021

Hello

We currently need to save PDF documents to several folders.  One folder will be always be a differentj ob specific  folder. The 2nd will be 1 of 3 different locations depending on the trade on the job. Is is possible to create a cmd , that once the pdf document is saved to the job specific folder, it will "automaticlly" be save to the trade folder.  Perhaps a differnt cmd for each trade.

 

Thank you

TOPICS
Create PDFs
2.5K
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 ,
Nov 12, 2021 Nov 12, 2021

This requires using a script, but it has to run from a trusted context, such as a folder-level .js file that will have to be installed on each machine that will use this file.

For more info see: https://acrobatusers.com/tutorials/how-save-pdf-acrobat-javascript

 

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 ,
Nov 12, 2021 Nov 12, 2021

Thank you.  Will look into that.

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 ,
Nov 12, 2021 Nov 12, 2021

Here's a better link:

https://www.pdfscripting.com/public/How-to-Save-a-PDF-2.cfm

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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 ,
Nov 16, 2021 Nov 16, 2021

Thank you.

I have the script running in debugger.  I cannot figure out how to add it as a "tool/button" on the tool bar.

This command will be run for different pdf documents.

 

Thanks

 

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 ,
Nov 16, 2021 Nov 16, 2021
LATEST

The console window in the debugger is a privileged context. As noted in the article, the saveAs command only works in a  privileged context. So it will only work from a document script if that document is trusted, which the user needs to do.  The solution provided in the first article linked above is to create a folder level trusted function, but there are different ways to create trust, such as adding the PDF to the trusted document list in the Acrobat Enhanced Security Preferences. 

 

https://www.pdfscripting.com/public/Trust-and-Privilege-in-Acrobat-Scripts.cfm

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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