[Zope] Zope and PDF

Alastair Burt burt@dfki.de
19 Oct 2001 13:51:04 +0200


"Tom Cameron" <tom@cameron.to> writes:

> I have a need to create PDF files from a Zope application. I have been
> reading this thread on PDFs. I have no idea how to start creating pdf files.
> I have taken a look at reportlab and it looks all a bit too complex for what
> I want.
> 
> I just what to convert an HTML doc to a PDF doc. Sounds simple enough.
> 
> Anyway, could anybody give me some hints as to where I should start. A
> couple of URLS or how to links.

There is a really simple solution, at least for the Unix world:

  html2ps file.html | ps2pdf

Using:

  http://www.tdb.uu.se/~jan/html2ps.html

and

  http://stat.tamu.edu/doc/gs/Ps2pdf.htm

To quote the html2ps web page, this will give you:

  * Many possibilities to control the appearance.

  * Support for processing multiple documents, also automatically by
    recursively following links.  

  * A table of contents can be generated, either from the links in a
    document, or automatically from document headings.

  * Configurable page headers/footers, that for example can contain
    document title, URL, page number, current heading, and date.

  * When converting the PostScript document to PDF - using some other
    program such as version 5.0 or later of Aladdin Ghostscript, or Adobe
    Acrobat Distiller - the original hyperlinks in the HTML documents will
    be retained in the PDF document.

  * Automatic hyphenation and text justification can be selected. 

It can handle images and pretty convoluted tables.

--- Alastair