From 29a5ced38bd3e4f689cdfcb681fd7f1c4c287017 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 8 Feb 2012 09:56:20 -0500 Subject: [PATCH] Add pdftk post and link other pdftk references to that post. --- posts/PDF_bookmarks_with_Ghostscript.mdwn | 7 +++---- posts/pdftk.mdwn | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 posts/pdftk.mdwn diff --git a/posts/PDF_bookmarks_with_Ghostscript.mdwn b/posts/PDF_bookmarks_with_Ghostscript.mdwn index c7fe6da..0c1d03b 100644 --- a/posts/PDF_bookmarks_with_Ghostscript.mdwn +++ b/posts/PDF_bookmarks_with_Ghostscript.mdwn @@ -1,5 +1,5 @@ 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 +[[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: @@ -42,8 +42,8 @@ reference][reference]. I've bundled the whole pdfmarks-generation bit into a script, [[pdf-merge.py]], which generates the pdfmark file and runs Ghostscript automatically. Think of it as a bookmark-preserving -version of pdftk's `cat`. The script uses pdftk internally to extract -bookmark information from the source PDFs. +version of pdftk's `cat`. The script uses [[pdftk]] internally to +extract bookmark information from the source PDFs. The script also adds a bit of PostScript to ignore any bookmarks in the source PDFs during the Ghostscript run. The only bookmarks in the @@ -52,7 +52,6 @@ If for some reason the automatically generated pdfmarks are not quite what you want, the script can pause (via `--ask`) to allow you to tweak the pdfmarks manually before running Ghostscript. -[pdftk]: http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/ [Ghostscript]: http://ghostscript.com/ [post]: http://ubuntuforums.org/showthread.php?t=1545064 [reference]: http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdfmark_reference.pdf diff --git a/posts/pdftk.mdwn b/posts/pdftk.mdwn new file mode 100644 index 0000000..02356e4 --- /dev/null +++ b/posts/pdftk.mdwn @@ -0,0 +1,19 @@ +[pdftk][] is a useful tool for manipulating PDFs. + +Unfortunately, there's a [bug][] in [[Gentoo's|Gentoo]] +`app-text/pdftk` package. The build eventually crashes with: + + g++ -DPATH_DELIM=0x2f -DASK_ABOUT_WARNINGS=false -DUNBLOCK_SIGNALS -fdollars-in-identifiers -DPDFTK_VER=\"1.44\" -Wall -Wextra -Weffc++ -O2 -I../java pdftk.cc -c + pdftk.cc:60:39: fatal error: com/lowagie/text/Document.h: No such file or directory + +Which is due to a bad `-m64` option brought in by `CFLAGS_amd64`: + + gcjh -force --classpath=":/var/tmp/portage/app-text/pdftk-1.44/work/pdftk-1.44-dist/java:." com/lowagie/text/Chunk + gcjh: unrecognized option '-m64' + +You can successfully install pdftk with: + + CFLAGS_amd64="" emerge -av pdftk + +[pdftk]: http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/ +[bug]: https://bugs.gentoo.org/show_bug.cgi?id=254463 -- 2.26.2