setting the active doc and adding page numbers

Explorer ,
Dec 13, 2018

Copy link to clipboard

Copied

var openDoc = app.openDoc({cPath: myPath});

var d = app.activeDocs; <--gets all open docs

app.alert("this.path: " + this.path);  <--this.path is not always the openDoc. 

app.alert("openDoc.path: " + openDoc.path);

How do I make the openDoc the active Doc?  Essentially I am needing to add page numbers to it.

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

You can try using the bringToFront method, but there's really no need to do it. Just use the openDoc variable instead of the "this" variable.

TOPICS
Acrobat SDK and JavaScript

Views

53

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

setting the active doc and adding page numbers

Explorer ,
Dec 13, 2018

Copy link to clipboard

Copied

var openDoc = app.openDoc({cPath: myPath});

var d = app.activeDocs; <--gets all open docs

app.alert("this.path: " + this.path);  <--this.path is not always the openDoc. 

app.alert("openDoc.path: " + openDoc.path);

How do I make the openDoc the active Doc?  Essentially I am needing to add page numbers to it.

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

You can try using the bringToFront method, but there's really no need to do it. Just use the openDoc variable instead of the "this" variable.

TOPICS
Acrobat SDK and JavaScript

Views

54

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
Dec 13, 2018 0
Most Valuable Participant ,
Dec 13, 2018

Copy link to clipboard

Copied

You can try using the bringToFront method, but there's really no need to do it. Just use the openDoc variable instead of the "this" variable.

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...
Dec 13, 2018 0