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

Delete ALL BookMarks in PDF file

Participant ,
Jan 11, 2021 Jan 11, 2021

Hi friends!

I have Acrobat PRO and someone gave me a PDF file with hundreds of totally unnecessary bookmarks. 

Is there a way I can delete them all in one shot?

Keep in mind: Total ignoramus here...

 

Thank You

Susan

TOPICS
Edit and convert PDFs
32.9K
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 11, 2021 Jan 11, 2021

Use File > Create > Combine Files into a Single PDF...
Add your file
At the options disable "Always add bookmarks to Adobe PDF"
Press Combine

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 11, 2021 Jan 11, 2021

If you do that you'll lose a bunch of potentially important information, such as the file's metadata.

There are much easier ways of doing it. Just open the Bookmarks panel, click into it, press Ctrl+A and then Delete.

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 11, 2021 Jan 11, 2021

Use File > Create > Combine Files into a Single PDF...
Add your file
At the options disable "Always add bookmarks to Adobe PDF"
Press Combine

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 ,
Jan 11, 2021 Jan 11, 2021

Worked perfectly. 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
Community Expert ,
Jan 11, 2021 Jan 11, 2021

If you do that you'll lose a bunch of potentially important information, such as the file's metadata.

There are much easier ways of doing it. Just open the Bookmarks panel, click into it, press Ctrl+A and then Delete.

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 ,
Apr 28, 2024 Apr 28, 2024

Hi,

I tried both of these tips and they are not working for me. Nothing happens when I open bookmark sidebar, click into it and then I press Ctrl+A and Delete. Zippo. Why isn't there a choice in the options to clear/delete them all??? Would be so much easier! I have 165 documents to take the bookmarks out of and its going to take me soo much time to do. Not a happy camper.

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 ,
Apr 29, 2024 Apr 29, 2024

You can do it using a simple script, as a part of an Action, and run it on multiple files.

This is all the code you need:

 

this.bookmarkRoot.remove();

 

Add an "Execute JavaScript" command to the action with that code (and make sure to untick the "Prompt User" check box), followed by a Save command and run it on your files, and all the bookmarks will be removed from all of them.

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 ,
Oct 10, 2024 Oct 10, 2024

Can you explain this in more detail as a steb by step guide.  I have over 500 files which specific file names, maybe this action would help me delete all bookmarks without changing file names and their specific locations.

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 ,
Oct 10, 2024 Oct 10, 2024

Go to Tools - Action Wizard (in Acrobat Pro) and create a new Action. Add to it a command to Execute JavaScript (under More Tools) with the code above. Make sure to untick the "Prompt User" check-box.

Then add a Save command after that, so it looks like this:

try67_0-1728592380951.pngexpand image

 

Now run this Action on your files, and all the bookmarks in them will be removed, and the files saved under their original paths. If you want to save them under a different name or folder that can be set under the settings of the Save command in your Action.

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 ,
Oct 10, 2024 Oct 10, 2024

Worked like a charm!

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
Explorer ,
Oct 17, 2024 Oct 17, 2024

Is there a way to modify this so it'll delete bookmarks at certain levels? For instance, I'm compiling a couple of dozen Word documents into a single PDF, and I'd like to keep the top-level bookmarks which mark out the original individual documents, but I don't really want to keep the next-level bookmarks within them. Not least because the Word documents were set up so that every text style is a heading, so the bookmarks end up containing essentially a duplicate of the entire text.

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 ,
Oct 17, 2024 Oct 17, 2024

Yes, that's possible. Use this code:

 

for (var i=0; i<this.bookmarkRoot.children.length; i++) {
	var bkm = this.bookmarkRoot.children[i];
	if (bkm.children!=null) {
		for (var j=bkm.children.length-1; j>=0; j--) {
			bkm.children[j].remove();
		}
	}
}
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
Explorer ,
Oct 17, 2024 Oct 17, 2024

Thanks very much, but that actually made it worse! It removed the document title bookmarks, left the heading-level ones from the first document only, and added a load of gibberish ones that went nowhere.

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
Explorer ,
Oct 17, 2024 Oct 17, 2024

Actually, I at least partially take that back. It didn't remove the document title bookmarks - it turns out that I didn't have any in the first place.  My apologies.

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 ,
Oct 17, 2024 Oct 17, 2024

The code does just what you asked for: Delete all bookmarks except for the top ones. It doesn't add anything or change anything else. If it's not doing what you wanted then you need to better describe your needs.

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 ,
Oct 17, 2024 Oct 17, 2024

A separate question, the link you privided removed all the bookmarks, thanks again.  Is there any Java Script to hide Bookmark Panel on the left, so just the pdf page is visible.  Like in Navigation tab "Page Only" is selected instead of "Bookmark Panel and Page" by running that script?

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 ,
Oct 17, 2024 Oct 17, 2024

Try this:

this.pane = "N";

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 ,
Oct 17, 2024 Oct 17, 2024

Again worked like charm!

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
Community Beginner ,
Oct 17, 2024 Oct 17, 2024

It not saving the pdf though. If i close the pdf and reopen I can still see the bookmark panel.

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 ,
Oct 17, 2024 Oct 17, 2024

That's because this code doesn't change the Initial View setting, but if you add it to the file as a doc-level script it will execute when the file is opened and should override that setting. But the best solution is to change that setting manually, if you can.

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 ,
Oct 17, 2024 Oct 17, 2024
LATEST

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
Explorer ,
Oct 17, 2024 Oct 17, 2024

I'm sorry. I did accurately describe my needs, and your solution did do as you said. It just turned out that the other part of the process - combining the files into a single PDF - didn't produce the expected results. I was initially doing it in Acrobat Pro on the desktop, which produced a PDF as described with a bookmark for each original document title and sub-bookmarks for headings within them, but it always crashed when trying to save. So I switched to doing it online, which worked, but I failed to notice it didn't produce the same bookmarks - just some headings from the first document and then some gibberish. Hence my pretty immediate rectraction as soon as I realised that. I would've deleted the earlier reply if I could.

 

Again, sorry, your solution worked, it was something else that didn't. I just did without bookmarks altogther in the end.

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 ,
Oct 17, 2024 Oct 17, 2024

That's fine, don't worry about it. Glad to hear it's working well!

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