Re: Web content to PDF converter
Brodbeck Andreas <[email protected]> Thu, 13 Aug 2020 10:02:22 +0200
| Newsgroups | gmane.comp.lang.smalltalk.squeak.seaside |
|---|---|
| Message-ID | <[email protected]> |
Hi Bob Usually I generate HTML to a file with seaside techniques and then convert it with the open source command line tool "wkhtmltopdf". To generate HTML I use something like this: ************************** component := ... builder := WAHtmlCanvas builder codec: (GRCodec forEncoding: 'utf-8'); fullDocument: true; resourceUrl: 'file:///path/to/local/webroot/files'; rootBlock: [:root | root title: 'blabla'. root beHtml5. root stylesheet resourceUrl: 'css/style.css'. component updateRoot: root]; yourself. xhtmlString := builder render: component. GRPlatform current write: xhtmlString toFile: 'blabla.html' inFolder: 'xyz'. ************************** Cheers, Andreas > Am 12.08.2020 um 15:06 schrieb Bob Nemec <[email protected]>: > > There a number of tools for converting web content to a PDF. > Has anyone used one from within Seaside? > I'd like to generate a PDF from a div, not the entire page. > > We already use PDF4Smalltalk and Report4PDF with a rudimentary HTML parser. > It can create PDF content for HTML that has bold, underline and italic markup. > Users use this to add content to reports. Report4PDF can render the user content either as HTML or generate a PDF. > Complex content, like tables and images, is not supported. And I have not interest in adding support. > > For code generated content Report4PDF works fine. But for user entered content it is not optimal. > I'd rather use something that can represent complex user content. > > Anyone have experience with this? > > Thanks, > Bob Nemec > > _______________________________________________ > seaside mailing list > [email protected] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside _______________________________________________ seaside mailing list [email protected] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside