[GTALUG] Fedora 22 Live Workstation Install - no fglrx - no pdftk
Stewart C. Russell
scruss at gmail.com
Sun Jul 26 13:43:03 UTC 2015
Hi Russell:
>
> Well there is one exception, no more pdftk support. (Licensing issues
> with iText5+)
Hmm, that's odd. The iText AGPL change was some time ago, and pdftk
Server (as Sid now calls it) is distributed as source. It's not too
difficult a build, but is somewhat slow and memory intensive, as it does
everything with gcj.
> I note that there are several GUI tools now available to assist with
> sorting pdf pages but I was really hoping to find something in the
> command line arena which I could then poke into this script.
You might not be able to replace it all, but here are some options:
* pdfinfo (from poppler or xpdf; the former is a fork of the latter)
will give you the number of pages.
* qpdf will extract and combine pages. It also has some neat tricks for
cleaning up the detritus that Adobe's two lines of entirely incompatible
PDF generation tools (Acrobat and DeathSpiral, um sorry, LiveCycle)
leave behind.
* For the pagination watermark, that's one thing that iText does well.
To avoid it, you could either:
1) convert to PostScript and wedge a line of code in on every page
preamble with the page number. If you're relying on previously-existing
bookmarks in the PDF, this will likely break them. (Then again, you're
printing the file, so you're probably not worried about this.)
2) qpdf has a text output mode, QDF, that is /sorta/ editable. It looks
possible that you could add a text object at the top of the page, then
reassemble to PDF. Haven't tried it, though.
The difficulty with hand editing PDF is that everything is an object,
with a hard-coded reference number and (seemingly) fixed byte offset in
the stream. You change anything without fixing those references, it breaks.
cheers,
Stewart
More information about the talk
mailing list