PDFs from Seaside

The website of Seaside has seen a recent addition of documentation. A frequently asked question in the mailing list is on the creation of PDFs from Seaside web applications. Unfortunately there is not a single answer that rules them all, but there are many possibilities to choose from.

PDF in Seaside

The initiative of writing a document was started by Stephan Eggermont and myself at ESUG 2008 in Amsterdam. Later on, Michael Rueger and Boris Popov contributed snippets and corrections here and there. The document is not finished and it doesn’t provide a final answer either, but it gives a broad overview of the possibilites and the advantages and disadvantages of the different approaches. We believe that after reading, you can easily choose the approach that suits you the best.

And, best of all, this is not really Seaside specific. It is more of a Smalltalk thing.

Posted by Lukas Renggli at 3 October 2008, 10:28 pm with tags seaside, smalltalk, pdf link

Comments

Why would pdflatex not work with VW?

Posted by Stefan Schmiedl at 4 October 2008, 11:00 am link

We’ve been using Seaside with www.princexml.com. We use seaside to generate html, with some special tags for headers and footers, landscape and portrait. What’s nice about it is that you can look at it in a browser and then produce a pdf doc from that. Also, using seaside itself to produce the document is great. It uses stylesheets and produces a reasonable document from that. It is commercial (unfortunately).

A code snippet: HTMLToPDFDocumentGenerator | asMIMEDocumentType: mimeType | content pidPDF | content := WARenderCanvas builder fullDocument: true. content rootBlock: [:root | root title: ’PID Form’. root stylesheet url: ’/files/pidform.css’]. pidPDF := self convertHtmlToPDF: (content render: [:html | form renderContentOn: html]). ^ SeasidePlatformSupport mimeDocumentClass contentType: mimeType content: pidPDF

Posted by Otto Behrens at 6 October 2008, 9:25 pm link

Nice documentation!

Reverse question: how do I read a PDF with Smalltalk?

Posted by Adrian Kuhn at 7 October 2008, 2:11 am link

Stefan: I have no reason to assume vw doesn’t work with pdflatex, but I haven’t spoken to anyone who tried it. Please provide a code snippet of how to call pdflatex so we can update the page.

Adrian: parsing PDF is a lot of work, and only provides (very) low-level document structure: not even lines of text. Only with a lot of context is it possible to build a usable document model.

Posted by Stephan Eggermont at 7 October 2008, 12:54 pm link