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

Explorer ,
Jan 23, 2018

Copy link to clipboard

Copied

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?

Adobe Community Professional
Correct answer by Thom Parker | Adobe Community Professional

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.

TOPICS
Acrobat SDK and JavaScript, Macintosh, Windows

Views

129

Likes

Translate

Translate

Report

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

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

Explorer ,
Jan 23, 2018

Copy link to clipboard

Copied

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?

Adobe Community Professional
Correct answer by Thom Parker | Adobe Community Professional

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.

TOPICS
Acrobat SDK and JavaScript, Macintosh, Windows

Views

130

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jan 23, 2018 0
Most Valuable Participant ,
Jan 23, 2018

Copy link to clipboard

Copied

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).

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 23, 2018 0
Adobe Community Professional ,
Jan 23, 2018

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 23, 2018 0
Explorer ,
Jan 23, 2018

Copy link to clipboard

Copied

HTTP

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 23, 2018 0
Adobe Community Professional ,
Jan 23, 2018

Copy link to clipboard

Copied

No

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 23, 2018 0
Adobe Community Professional ,
Jan 23, 2018

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 23, 2018 1
Explorer ,
Jan 23, 2018

Copy link to clipboard

Copied

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?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 23, 2018 0
Adobe Community Professional ,
Jan 23, 2018

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 23, 2018 2