Showing posts with label pdftk. Show all posts
Showing posts with label pdftk. Show all posts

Wednesday, June 8, 2011

Pdftk - The PDF Toolkit

Pdftk - The PDF Toolkit


Superimpose Pages with pdftk

pdftk packs iText’s power into a standalone program. Apply a single PDF page to the background of an entire document like so:
pdftk mydoc.pdf output mydoc.marked.pdf background watermark.pdf
pdftk will use the first page of watermark.pdf, if it has more than one page. You can combine this background option with additional input operations (such as assembling PDFs [Hack#51]) and other output options (such as encryption [Hack #52]).

Thursday, February 10, 2011

xpdf: Error (...): Missing 'endstream'

There are a few PDF documents around here, that I can read with Acrobat Reader w/o problems, but xpdf and its companions moan. I guess, that's because they got modified and a little destroyed using Acrobat X Pro.

I used pdftk to get rid of that problem: first output/uncompress, than output/compress again:

$ pdftk x.pdf output \
    x.uncompressed.pdf uncompress
$ pdftk x.uncompressed.pdf output \
    x.recompressed.pdf compress

Wednesday, January 5, 2011

how to burst a PDF document into single pages (etc.)

This command line shows, how to get the output files named your way:

$ pdftk … burst output 'page.%02d.pdf'

Split Select Pages from Multiple PDFs into a New Document:

$ pdftk A=one.pdf B=two.pdf cat A1-7 B1-5 A8 output combined.pdf


Select a single page into a new document:

$ pdftk A=one.pdf cat A130 output one.p130.pdf


Please find more information (like examples, man page, …) on pdftk here!

Friday, December 10, 2010

form fields in PDF – how to retrieve their details?

This command line shows you a few details:

$ pdftk … dump_data_fields

Not enough details for me.

What about CAM::PDF?
It comes with a couple of nice sample utilities (the bin/ subdirectory), one of them is called listpdffields.pl . It also does not show me enough details, but I think I will enhance that one.

Update / 2010-12-11:
Yes, CAM::PDF works very well for me. I wrote another article on that.

Wednesday, December 8, 2010

building pdftk-1.44 on opensuse-11.3

I just succeeded building the current pdftk using Makefile.Redhat with no modifications at all.

Precondition: have the GCJ RPM-s and the fastjar RPM installed.

I tried hard to ignore all the warnings regarding the Java source code.

Saturday, August 7, 2010

ruby and PDF

the speaker: Lukas Rieder
working for "paper c"

some approaches

writing PDF
... act as flying saucer ...

UNIX tools

xpdf :
$ pdftotext -layout -enc UTF-8 ...

pdftk
$ pdftk compressed.pdf uncompress output uncompressed.pdf

imagemagick
$ convert ... # e.g. towards JPEG

the speaker wrapped some unix tools and called that "PdfUtils", and released it as GEM.