pdftk is a useful tool for manipulating PDFs.

Unfortunately, there's a bug in Gentoo's 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