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

Is there a way to access arbitrary Acrobat program arguments in JavaScript?

Explorer ,
Jan 23, 2018 Jan 23, 2018

I have a folder-level JavaScript file installed in the user javascript folder. I'm wondering if there's a way to pass a URL as a parameter when launching Acrobat and to have the folder-level JavaScript code access the URL so that it can use that particular URL. Is this possible?

TOPICS
Acrobat SDK and JavaScript , Windows
1.2K
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

correct answers 1 Correct answer

Community Expert , Jan 23, 2018 Jan 23, 2018

Ok, there is a way, but it's old and I haven't tried it.  There are a set of command line parameters you can use when opening a PDF.

http://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/pdf_open_parameters.pdf

One of these is a references to an FDF file. The FDF file could easily contain either a script that sets a document level variable, or it could fill a hidden form field.

Translate
Community Expert ,
Jan 23, 2018 Jan 23, 2018

Not really. You can access a web-service using the Net.HTTP object, but you can't just access a URL and use its contents (unless you convert it to a PDF file first, which is very tricky since it's done asynchronously).

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 ,
Jan 23, 2018 Jan 23, 2018

Is the URL local (file:///...) or HTTP?

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
Explorer ,
Jan 23, 2018 Jan 23, 2018

HTTP

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 ,
Jan 23, 2018 Jan 23, 2018

No

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
Community Expert ,
Jan 23, 2018 Jan 23, 2018

Ok, there is a way, but it's old and I haven't tried it.  There are a set of command line parameters you can use when opening a PDF.

http://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/pdf_open_parameters.pdf

One of these is a references to an FDF file. The FDF file could easily contain either a script that sets a document level variable, or it could fill a hidden form field.

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
Explorer ,
Jan 23, 2018 Jan 23, 2018

Thanks for the link. I see in that PDF:

Acrobat.exe /A "zoom=1000" "C:\example.pdf"

So I was hoping I could so something like:

Acrobat.exe /A "foo=bar" "C:\example.pdf" and access "app.foo" or "this.foo" in JavaScript but it doesn't seem to work. So an FDF file is the only way?

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 ,
Jan 23, 2018 Jan 23, 2018
LATEST

Not only is an FDF file the only reasonable way to pass data into the PDF using these options, PDF was built for FDF. It's a fantastic way to get stuff into a PDF. Its not just form data, its all kinds of things. For example, you can update page content with an FDF.

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