Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Use File > Create > Combine Files into a Single PDF...
Add your file
At the options disable "Always add bookmarks to Adobe PDF"
Press Combine
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Use File > Create > Combine Files into a Single PDF...
Add your file
At the options disable "Always add bookmarks to Adobe PDF"
Press Combine
Copy link to clipboard
Copied
Worked perfectly. Thank You
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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:
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.
Copy link to clipboard
Copied
Worked like a charm!
thank you
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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();
}
}
}
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
Try this:
this.pane = "N";
Copy link to clipboard
Copied
Again worked like charm!
Thank you!!
Copy link to clipboard
Copied
It not saving the pdf though. If i close the pdf and reopen I can still see the bookmark panel.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Thank you
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
That's fine, don't worry about it. Glad to hear it's working well!

