[Chicago] writing pdf files from python

Phil Robare verisimilidude at gmail.com
Tue Sep 9 19:42:35 CEST 2008


Yeah, I was the guy trying to read a PDF last month (not write one).
The problem is hard if the PDF was not generated by a reasonable
process.  Basically the format allows you to just say 'put a character
here at this x-y location, another one there, etc.' with no metadata
as to what constitutes a line, paragraph, text block or whatever.  If
one wanted to they could put all the a's on the page, then all the b's
and so on through all the glyphs.  Fortunately real applications don't
do that. The evolution of the standard to allow things like fill-in
forms and internal (page-based) navigation was what was throwing me
since in the document I was trying to interpret were multiple index
blocks which the software (pdftools from
www.boddie.org.uk/david/Projects/Python/pdftools/) did not handle.  By
the way that is a nicely written pure python set of routines to
dissect a PDF and probably would help for most PDFs - the couple of
PDF books I have from O'Reilly were read without problem.

Writing a PDF is comparatively easy - the multiple examples on this
page will do.

Phil

On Tue, Aug 19, 2008 at 8:03 PM, Lukasz Szybalski <szybalski at gmail.com> wrote:
> Hello,
> On the last meeting one of you mentioned that you wanted to write pdf
> from python.
> ...


More information about the Chicago mailing list