Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I heard that bookmarks of a pdf file are stored in plain text somewhere in the file. I was wondering if it is possible to import and export bookmarks of a pdf file into and from a text file, for batch processing?

If yes, is there any description on the syntax for editing the text file containing bookmarks of a pdf file?

I was hoping for free software solutions for Ubuntu 10.10 and for Windows 7.

Thanks and regards!

share|improve this question

2 Answers 2

up vote 7 down vote accepted

There's quite a variety of tools that can extract bookmarks from a pdf to a plain text file, and vice versa. For example, you can use pdftk, the iText toolbox (older versions only, get itext-2.0.1.jar), my own pdfWritebookmarks tool, and JPdfBookmarks which even has a GUI.

I have a script that can convert between the formats of many of these tools: bmconverter.py.

Another very nice way is to add bookmarks to a pdf via pdflatex.

share|improve this answer

The specification for PDF files is available as a freely downloadable PDF from Adobe - or at least it was last time I checked. However, most PDF files have most compressible data in them compressed. There probably was a basically plaintext version of PDF once upon a time, and if so it will still be valid now, but actually getting a file in that form may be a problem.

Although I haven't done it, one very likely possibility (if you're willing to pay) is to buy Acrobat Pro, and to use the Javascript scripting abilities built into that application. To get you started...


This tutorial shows how to create bookmarks automatically using Javascript in Acrobat 7.0 Pro (the version included in Creative Suite CS2). Although that's getting a bit old, the same technique should work fine for newer versions.

Adobe applications do include a library for reading/writing text files using Javascript (something that Javascript doesn't have as standard), so it's possible to write your own import/export scripts, though non-trivial to make those scripts robust.

share|improve this answer
Thanks! Is there a Linux version of Acrobat Pro ? –  Tim Apr 28 '11 at 6:58
Sorry - I very much doubt it. AFAIK its a Mac or Windows thing, and Adobe are unlikely to support Linux unless a huge number of creative professionals (1) start using that platform, and (2) show that they're willing to pay lots for proprietary software rather than use FOSS alternatives. Seems unlikely. For a free solution, you might try a library such as blog.rubypdf.com/2007/12/12/… (for Ruby). I know even less about this - I just found it on Google. –  Steve314 Apr 28 '11 at 7:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.