BSD Magazine is a great and free magazine that deals with a wide range of BSD related subjects. The latest issue had a particular article that I felt I wanted to keep close to me.
Using Pdftk I was able to extract the pages that composed the article and keep it in a new PDF document.
Installing Pdftk on FreeBSD is a matter of changing to the print/pdftk port and issuing make install clean, like so:
# cd /usr/ports/print/pdftk
# make install clean
Make sure to build lang/gcc46 with the JAVA Enable the Java frontend (i386 and amd64 only) OPTION selected or else the build process will fail (take it from me I learned it the hard way).
If you prefer to use packages instead of the ports tree, issue the following commands instead:
# pkg_add -r pdftk
Now for the fun part: using Pdftk on the this months' BSD Magazine as an example. Start by downloading BSD Magazine 5/2012 issue which you can find here.
I wanted to extract the Hardening FreeBSD with TrustedBSD and Mandatory Access Controls article which runs from page 46 to 49, this how to do it using Pdftk:
$ pdftk 'BSD_05_2012.pdf' cat 46-49 output 'Hardening-FreeBSD-with-TrustedBSD-and-MAC.pdf'
You can find plenty of other uses for Pdftk in applications man page:
$ man pdftk