Cameron Laird's personal notes on PDF conversion utilities

Multitudes of FAQs and similar references for PDF information have been published in the past. As of 2003, I've found none that I regard as convenient and well-maintained in regard to the "filters" that transform files to and from PDF, not even the Conversion tools page of PDFZone or PlanetPDF's Extraction page--so I'll start my own.

The focus of this page ('anyone think I should re-do it as a Wiki?) is on the products available to convert to and from PDF images. IDR Solutions explains the challenge.

Ghostscript/Ghostview answers many questions, at least partially.

David Boddie's pdftools and David Leonard's PDFFile provide interesting Python-coded raw materials for those unafraid of dirtying their hands with programming. Early in 2005, one appreciated correspondent wrote me that the latter "handles things like decryption better." From what I can tell, PDFFile and python-pdftools do not write; they only read.



My clients often need to build reports which simply sequence existing (or generated) .pdf and/or .ps source. That's a far bigger undertaking than you might think, as Matthew Skala documents (in fact, I disagree with a few of his details, but he certainly gets the frustration right). Here are a few of the alternatives with which I've spent time:

A workaround for extreme situations is to "mollify" the PDF by roundtripping it through PS.

Sometimes it's necessary to decrypt a PDF instance. qpdf is an example of a utility that helps.

Products that extract text from PDF

Don't do it.

At least, that's my usual first response, although, as 2004 begins, a couple of products are making me soften that stance. I understand all the situations that make text-extraction appear to be desirable; I've lived through most of them myself. As several sages have counseled, however, from a programmatic standpoint, "think of PDF as paper", by which they mean you could use scissors and glue on it, but there's almost certainly a better way. Almost always, you're--we're--better off going upstream to the data where the PDFs originated. I'm happy to help analyze specific situations on a consulting basis to determine whether there's an appropriate alternative to text-extraction, and also to help your organization implement the text-extraction method that's best for it.

If you insist on extracting text from PDF, and choose not to engage our consultancy, you're likely to find your answer from the following list. This list remains partial; you're welcome to write me to ask that I unpack more of my notes, if you have specific requirements none of these meet.

[Also explain JPedal and PDFBox.]

I've exhorted developers often in my more formal publications not to retrieve text from PDF; a recent example was "Friends don't let friends ...", in Smart Development.

The most common legitimate reason to render PDF to text is in combination with some sort of search; that's certainly the application of this sort I most often automate. Search and "content management" specialists are generally aware of the issues involved, and often offer their own PDF extractors as plug-ins or add-ons.

Products that render PDF as JPG

For immediate results, Zamzar is a Web application that quickly converts one or a small number of PDF-defined pages [also mention YouConvertIt, Neevia]. Even quicker, for those running Mac OS, is simply to open Preview and SaveAs JPG.

An abundance of installable desktop applications include the capability to visualize a PDF page as, for example, JPG. Among them are:

Finally, for automation, ...

Products that render PDF as DOC or RTF

Products that render DOC or RTF as PDF

Togaware explains how to use OpenOffice to render .DOC to .PDF.

Products that transform PDF back to PS

The Glyph & Cog, LLC xpdf includes a pdftops utility.

Products that transform HTML to PS or PDF

In 2011, I moved the contents of this section to a new page.

Products that transform PS to PDF

In 2011, I moved the contents of this section to a new page.

Products that 'mollify' PDF

[Explain use of Acrobat, pdftk, pyPdf, iText, ...]

"PDF mollifiers fill crucial role" tells a bit more about what I think on this subject.

Products that validate PDF or PS


Here is the source mentioned in a "Smart Development post called "PDF pagination only takes a few lines". Phaseit, Inc. holds the copyright to this source. Use as you wish. If you make weapons with this code, are ill-humored, claim you originated it yourself, or think a court will support a lawsuit against Phaseit ... well, it's your soul that suffers.

In 2010, I'm testing APDF Number.


I often field questions such as, "I need to programmatically convert Office files to PDF. Is that possible / easy? How is that done?" I'll start with a few personal comments.

Adobe certainly wants people--especially those who control budget decisions--to think of it as the vendor-of-preference for all such needs. I respect Adobe for their business success and technical achievements. My experience as a front-line customer of theirs is ... mixed. My first instinct is to look for alternatives.

The dominant producers of PDF documents in the current market are Acrobat and Word. I suspect someone has reasonably accurate measurements of the share each holds; my rough impression is that the latter dominates. It certainly is feasible to automate Word in principle. While most Word scripters use VBA, I rely most on Tcl or Python ... There should be no effective barriers to full automation using Word's built-in facilities.

Word, however, emits bad PDF, and is often slow and unreliable, at least for the tasks that matter to me. Adobe frustrates me; I have a terrible history at trying to find out the simplest product information from the company. When I want "industrial-strength" automation, I turn to Antiword or OpenOffice. The latter produces higher-quality PDF than Word, and is more open about its scripting capabilities, at least on an ideologic level.

For special purposes, I've built even more involved "production lines" involving intermediate steps with PS, TeX, and other formats and technologies.

Miscellaneous PDF Products

PDF Javascript Stripper removes JS embedded in a PDF image.

PDF Writer Pro installs itself as a Windows printer driver which gives Windows applications the ability to write-to-PDF without Acrobat.

Enfocus Pitstop is a PDF preflight and editing package for the print industry.

PDF Crystal ...

[Explain capabilities and applicability of pdflatex, pdfpages ...]

Storypad ...

[I need to explain ReportLab, html2ps, ...]

Cameron Laird's personal notes on PDF conversion utilities/