These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Opening PDF With Associated External JavaScript File

eganopperman
Registered: Jul 1 2007
Posts: 4

Hi, I have a pdf document with 3 comments. Using the following JavaScript I can set the

annot object's hidden property to hide the three comments:
myAnnotList[0].hidden = true;
myAnnotList[1].hidden = true;
myAnnotList[2].hidden = true;

What I would like to do is have the option from the command line to open the document

with only one selected comment visible. My problem is that sometimes I will want to open

the document from the command line with only Comment 1 visible and at other times with

only Comment 2 visible. Is it possible to write 3 separate JavaScript files each making

a single comment visible (e.g. JS1.js makes visible comment 1; JS2.js makes visible

Comment 2, and, JS3.js makes Comment 3 Visible) and then from the command line run the

appropriate JavaScript when the document opens?

I have tried to tackle the problem without success using the comment's commentID
The Adobe's "Open Parameters for PDF" document provides the following example to for

opening document at a specific you can from the command line open comments using the

following parameter syntax "comment=commentId". The "Open Parameters for PDF" document

gives the following example to specify a comment on a given PDF page:

"#page=1&comment=452fde0e-fd22-457c-84aa-2cf5bed5a349"

Using the following Javascript I can determine the comment's commentID

this.syncAnnotScan();
var myAnnotList = this.getAnnots({nPage: 0});
console.println(myAnnotList);
[Markup 0 05e3f87a-45ee-4bfe-bbb8- 2acb0c1a086b]

Using the following command line syntax I can open the PDF to the specific page of the

comment I want to make visible. However, while the page and zoom factor work correctly

the comment does not become visible.

C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe /A"page=1&comment=05e3f87a-45ee-4bfe-bbb8- 2acb0c1a086b&zoom=73.9"F:\~PDF\doc1.pdf

Any solutions would be extremely appreciated. TIA. Egan.

lkassuba
ExpertTeam
Registered: Jun 28 2007
Posts: 3636
Unfortunately the commentId is not something that is generally available. There’s not even a JavaScript that allows you to determine it. This is more of an Acrobat developer feature for managed annotation servers.

Lori Kassuba is an AUC Expert and Community Manager for AcrobatUsers.com.