Reset popup note location with Javascript

New Here ,
Dec 31, 2018

Copy link to clipboard

Copied

I am running the code below to open every popup note with non-empty content. I would additionally like to reset the popup note location of each note as I open it, so that it does not overlap the content of the PDF but is off to the side in the margin. How can I do this? Thanks in advance.

My code:

this.syncAnnotScan();

annots = this.getAnnots({nSortBy: ANSB_Page});

if (annots) {

for (var i=1; i < annots.length; i++) {

if (annots.contents != "")

annots.popupOpen = true

}

}

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

Your code should work, but the loop should start from zero, not one.

To set the location of the popup you need to modify the popupRect property.

I recommend moving a popup manually off the page and then printing the value of this property to the console. That will give you a good idea of how it should work.

TOPICS
Acrobat SDK and JavaScript, Windows

Views

60

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

Reset popup note location with Javascript

New Here ,
Dec 31, 2018

Copy link to clipboard

Copied

I am running the code below to open every popup note with non-empty content. I would additionally like to reset the popup note location of each note as I open it, so that it does not overlap the content of the PDF but is off to the side in the margin. How can I do this? Thanks in advance.

My code:

this.syncAnnotScan();

annots = this.getAnnots({nSortBy: ANSB_Page});

if (annots) {

for (var i=1; i < annots.length; i++) {

if (annots.contents != "")

annots.popupOpen = true

}

}

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

Your code should work, but the loop should start from zero, not one.

To set the location of the popup you need to modify the popupRect property.

I recommend moving a popup manually off the page and then printing the value of this property to the console. That will give you a good idea of how it should work.

TOPICS
Acrobat SDK and JavaScript, Windows

Views

61

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

Copy link to clipboard

Copied

Your code should work, but the loop should start from zero, not one.

To set the location of the popup you need to modify the popupRect property.

I recommend moving a popup manually off the page and then printing the value of this property to the console. That will give you a good idea of how it should work.

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 31, 2018 1