ExifTool Forum

General => Metadata => Topic started by: jtgajda on January 26, 2017, 05:16:11 PM

Title: Extracting bookmarks from PDF files
Post by: jtgajda on January 26, 2017, 05:16:11 PM
I'm looking for a way to extract bookmarks and their associated anchors from pdf files.
Thank you in advance for any help or suggestions you may have.
Title: Re: Extracting bookmarks from PDF files
Post by: StarGeek on January 26, 2017, 05:53:05 PM
I could be wrong, but I don't think exiftool can do this.  I couldn't find this info in exiftool output of a pdf.

A quick search and it looks like pdftk (https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/) can do it with this command:
pdftk input.pdf dump_data Output output.txt
(output.txt is option, it will print to the command line if missing).

SuperUser (http://superuser.com/questions/276311/how-to-import-export-and-edit-bookmarks-of-a-pdf-file) answer with more options.
Title: Re: Extracting bookmarks from PDF files
Post by: jtgajda on January 27, 2017, 10:39:39 AM
Thank you for the suggestion.
Title: Re: Extracting bookmarks from PDF files
Post by: bertalanimre on February 03, 2017, 03:57:43 AM
Indeed PDFTK does the trick. HOWEVER!

I'm tasked to clean the PDF files without harming the content of tables. If I export it with pdftk, then remove the metadata from the PDF, I can't import the data back, since the dictionary is damaged on the PDF. Therefore I need a method to erease the metadata without harming the dictionary. Do you know how to do this?
Title: Re: Extracting bookmarks from PDF files
Post by: Phil Harvey on February 03, 2017, 07:13:28 AM
Quote from: bertalanimre on February 03, 2017, 03:57:43 AM
Therefore I need a method to erease the metadata without harming the dictionary. Do you know how to do this?

You answered your own question here (https://exiftool.org/forum/index.php/topic,8050.msg41123.html#msg41123).

- Phil