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

Delete text from bookmarks

Community Beginner ,
Jan 21, 2025 Jan 21, 2025

I have a PDF with 200 bookmarks. In these 200 bookmarks each bookmarks starts with 001, 002, 003 then some individual text after these 3 numbers. I would like to delete the 3 numbers in each bookmark but keep the individual text. I have adobe Acrobat and plugin bookmark and splitdocuments. I am deseperate for help. 

TOPICS
How to , PDF
344
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
2 ACCEPTED SOLUTIONS
Community Expert ,
Jan 22, 2025 Jan 22, 2025

Run this script in the JavaScript console:

 

for (var i=0; i<this.bookmarkRoot.children.length; i++) {
var bkm = this.bookmarkRoot.children[i];
bkm.name = bkm.name.replace(/\d\d\d/g, "");
}

 

 

Or run this one if after the 3 digits there is a space that you also want to delete:

 

for (var i=0; i<this.bookmarkRoot.children.length; i++) {
var bkm = this.bookmarkRoot.children[i];
bkm.name = bkm.name.replace(/\d\d\d\s/g, "");
}

 

 


Acrobate du PDF, InDesigner et Photoshoptographe

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 ,
Jan 22, 2025 Jan 22, 2025

This might delete other numbers as well. I would adjust it to:

 

.replace(/^\d*\s*/, "");

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 ,
Jan 21, 2025 Jan 21, 2025

Are the bookmarks all at the top-level, or are there sub-bookmarks, sub-sub-bookmarks, etc.?

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 ,
Jan 21, 2025 Jan 21, 2025

They are all at top 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 ,
Jan 22, 2025 Jan 22, 2025

Run this script in the JavaScript console:

 

for (var i=0; i<this.bookmarkRoot.children.length; i++) {
var bkm = this.bookmarkRoot.children[i];
bkm.name = bkm.name.replace(/\d\d\d/g, "");
}

 

 

Or run this one if after the 3 digits there is a space that you also want to delete:

 

for (var i=0; i<this.bookmarkRoot.children.length; i++) {
var bkm = this.bookmarkRoot.children[i];
bkm.name = bkm.name.replace(/\d\d\d\s/g, "");
}

 

 


Acrobate du PDF, InDesigner et Photoshoptographe
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 ,
Jan 22, 2025 Jan 22, 2025

This might delete other numbers as well. I would adjust it to:

 

.replace(/^\d*\s*/, "");

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 ,
Jan 22, 2025 Jan 22, 2025
LATEST

THANK YOU so much! This script worked and saved me days of removing it manually. Time saved is money saved as we say in Norway 🙂 

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