From: W. Trevor King Date: Mon, 26 Sep 2011 17:53:49 +0000 (-0400) Subject: Add PDF bookmarks with Ghostscript post. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=df0fe353a4493dc96a68da253036260d7b383648;p=mw2txt.git Add PDF bookmarks with Ghostscript post. --- diff --git a/posts/PDF_bookmarks_with_Ghostscript.mdwn b/posts/PDF_bookmarks_with_Ghostscript.mdwn new file mode 100644 index 0000000..af22b97 --- /dev/null +++ b/posts/PDF_bookmarks_with_Ghostscript.mdwn @@ -0,0 +1,22 @@ +I was recently trying to add bookmarks to a [[PDF]] I'd generated with +[pdftk][]. It turns out to be fairly simple to add bookmarks to a PDF +using [Ghostscript][], following [maggoteer's post][post] to the +Ubunto forums. The syntax is: + + $ gs -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=out.pdf in-*.pdf pdfmarks + +Where `out.pdf` is the generated PDF, `in-*.pdf` are the input PDFs, +and `pdfmarks` is a text file with contents like: + + [/Title (Title Page) /Page 1 /OUT pdfmark + [/Title (Table of Contents) /Page 3 /OUT pdfmark + ... + +Nice and easy. + +[pdftk]: http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/ +[Ghostscript]: http://ghostscript.com/ +[post]: http://ubuntuforums.org/showthread.php?t=1545064 + +[[!tag tags/tools]] +[[!tag tags/linux]]