• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Creating Bookmark with Javascript works fine in Acrobat Pro but not in Acrobat Reader

New Here ,
Jan 17, 2019 Jan 17, 2019

Copy link to clipboard

Copied

Hello,

I added a simple JS function in Acrobat Pro DC, that creates a bookmark when a button is clicked. It works fine in Acrobat Pro, but when my client opened it in Acrobat Reader it didn't.

I also added some debugging alerts before and after the bookmark function to check whether the function is called in Reader and to exclude that there is an error in the line itself. Both were fired.

Here is the code:

function addBookmark(label) {
  var index = bookmarkRoot.children ? bookmarkRoot.children.length : 0;
  //bookmarkRoot.createChild(label, "this.pageNum = " + (this.pageNum), index);
  alert("bookmarkRoot'"+this.bookmarkRoot.children[0]+"'");      
  this.bookmarkRoot.createChild("Bookmark label", "this.pageNum = 4");    
  this.bookmarkRoot.createChild("Bookmark label2", '"this.pageNum=4"');     
  alert("finished");
}

Any ideas why the bookmarks aren't created and how can I proceed with debugging it?

Thank you in advance,

Peter

TOPICS
Acrobat SDK and JavaScript , Windows

Views

1.7K

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
community guidelines

correct answers 1 Correct answer

Community Expert , Jan 17, 2019 Jan 17, 2019

You can't add bookmarks in Reader, not manually nor using a script.

Votes

Translate

Translate
LEGEND ,
Jan 17, 2019 Jan 17, 2019

Copy link to clipboard

Copied

No debugging needed, it's in the documentation:

It's vital to check the Quick Bar for every method you intend to use, especially but not only if you intend to use it in Reader.

Votes

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
community guidelines
Community Expert ,
Jan 17, 2019 Jan 17, 2019

Copy link to clipboard

Copied

LATEST

You can't add bookmarks in Reader, not manually nor using a script.

Votes

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
community guidelines