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

Creating Bookmarks with the same name as Page automatically.

Community Beginner ,
Jul 09, 2019 Jul 09, 2019

Hello,

I am looking to create bookmarks that are the same name as the page. I want to do this because I need to split the document up afterwords and want each file to have the same name as the page. All my pages are named correctly, I just need to create the bookmarks that have the same name as the page so when I spilit them they will have the same name as the page.  I have 200+ pages per document so any automation would be helpful.

Thank you!

TOPICS
General troubleshooting
6.1K
Translate
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
1 ACCEPTED SOLUTION
Community Expert ,
Jul 09, 2019 Jul 09, 2019

You can use this code to do it:

this.bookmarkRoot.remove();

for (var i=0; i<this.numPages; i++) {

    this.bookmarkRoot.createChild({cName: this.getPageLabel(i), nIndex: i, cExpr: "this.pageNum = " + i});

}

View solution in original post

Translate
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 ,
Jul 09, 2019 Jul 09, 2019

When you say "page name", what do you mean, exactly?

Translate
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 Beginner ,
Jul 09, 2019 Jul 09, 2019

Its the name that is the box left of the (1 of 100) and to the right of the the page up and down buttons. I need that name to be the name of the bookmark and ultimately the name of the document after I split it. 

Translate
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 ,
Jul 09, 2019 Jul 09, 2019

So you want to add a bookmark for each page in the file, pointing to that page and with the same name as the page?

The page's name is probably just "1", by the way, not "1 of 100".

Translate
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 ,
Jul 09, 2019 Jul 09, 2019

You can use this code to do it:

this.bookmarkRoot.remove();

for (var i=0; i<this.numPages; i++) {

    this.bookmarkRoot.createChild({cName: this.getPageLabel(i), nIndex: i, cExpr: "this.pageNum = " + i});

}

Translate
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 Beginner ,
Jul 09, 2019 Jul 09, 2019

Thank you! The script comes back as undefined though. It does remove the bookmarks though. Just doesn't add them back.

Translate
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 ,
Jul 09, 2019 Jul 09, 2019

You must select all of the code before running it. And "undefined" is not an error. Quite the opposite, actually. It means the script executed correctly, without errors and without returning any values.

Translate
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 Beginner ,
Jul 09, 2019 Jul 09, 2019

Damn I am noob at this! Thank you so much! You just made my life so much easier.

Translate
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 Beginner ,
Jul 09, 2019 Jul 09, 2019

Now the document is not splitting right. It not splitting at all ,it just recreating a new file with the name of the last bookmarked page. I really have no idea what is going on because everything should be high level.

Translate
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 ,
Jul 09, 2019 Jul 09, 2019

That's probably happening because the bookmarks use a script to point to the pages, instead of a "Go to a page" action.

You can still split the file, using a script, like this (paid-for) one I've developed: Custom-made Adobe Scripts: Acrobat -- Extract Chapters by Bookmarks

Translate
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 Beginner ,
Jul 09, 2019 Jul 09, 2019

Damn. Thank you still! I will try to figure it out on my own $40 is to much right now!

Translate
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 Beginner ,
Jul 09, 2019 Jul 09, 2019

I was just using the 1 of 100 as reference to the box  I was talking about. I am working on some drawings so the what I looking at is like C-1 (1 of 10) then C-2 (2-10). I just need the bookmark to be C-1,C-2  ect.

Translate
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
LEGEND ,
Jul 09, 2019 Jul 09, 2019

The important thing is to know that these page names are called "page labels". You can use the JavaScript method getPageLabel to get the page label string for any page. Then you can create bookmarks in the usual JavaScript way.

Translate
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 Beginner ,
Jul 09, 2019 Jul 09, 2019

I am very new to scripts. So page labels, not page names got it! Do have a quick link to the JavaScript method by chance. If not I can look it up better because I know the right terminology! Thank you!

Translate
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
Participant ,
Jul 09, 2019 Jul 09, 2019

Hi Bobg

I understand your situation, as per your description above, you want to create bookmarks for the pages of your document.

I hope this will fix the issue for you, keep us posted with the result.

Regards,

Amal

Translate
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 Beginner ,
Jul 09, 2019 Jul 09, 2019

Yes I am creating bookmarks the problem is that when I create the bookmark it says untitled. I was just wondering if there is a way to create a bookmark that is the same name as the page name instead of untitled. As of right now I am just going to the page creating the bookmark then renaming it. I just need a quicker way since I have 200+ page documents.  At the end I just want to extract the documents as individuals with file name as the as the page name. Also I am using Adobe Acrobat Pro.

Translate
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
New Here ,
Oct 12, 2020 Oct 12, 2020
LATEST

For any others that wish to accomplish this task: you can do it the manual way.

 

  1. Split the document on a page level.
  2. Download a bulk rename utility.
  3. Rename all of the files with the utility (usually a text file import with the current file name, this character (|), and the new name for every file.  For example: 'Pages from Document Name (2)|Learning the Alphabet', 'Pages from Document Name (3)|The First Step', 'Pages from Document Name (3)|The Second Step'.  This is easy using a copy file name utility and Excel's TEXTJOIN or CONCATENATE functions)
  4.  Combine all of the files into one PDF with the 'Always add bookmarks to Adobe PDF' selected.

 

Doing it this way is hardly elegant, but it doesn't take too long, and it works.

 

Another way is to use a trial version of bookmark utility/add-on.

Translate
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