Open a random PDF document using Javascript

joshuab24944986

20-11-2015

Hello,

I am trying to create a button in my XDP form that will function as a standard "Open Page" link in a typical PDF.  I want to be able to define the file path and the page number of a PDF and open the document in a new window to that page.

The target documents are provided by a third party and I have no ability to dictate format or anything else.

Any ideas?

Accepted Solutions (1)

Accepted Solutions (1)

joshuab24944986

23-11-2015

I found the answer.  radzmar was partially right.  It did use app.openDoc but required a trusted function and an extra command:

var mydoc = app.openDoc(path);

mydoc.pageNum = page;

Answers (3)

Answers (3)

radzmar

MVP

23-11-2015

There's also a openDoc method available to launch locally stored files.


try {


    // Open the "other.pdf" in the same directory


    app.openDoc("./other.pdf", event.target);


    // Close this doc


    event.target.closeDoc(true);


} catch (e) {}


joshuab24944986

23-11-2015

I need to open this in adobe standard NOT a web browser so the user can make edits to the target document.  LaunchURL won't work.  Is there anything like that to launch local files?