From df0fe353a4493dc96a68da253036260d7b383648 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Mon, 26 Sep 2011 13:53:49 -0400 Subject: [PATCH] Add PDF bookmarks with Ghostscript post. --- posts/PDF_bookmarks_with_Ghostscript.mdwn | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 posts/PDF_bookmarks_with_Ghostscript.mdwn 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]] -- 2.26.2