[Seaside] Web content to PDF converter

Brodbeck Andreas andreas.brodbeck at mindclue.ch
Thu Aug 13 08:02:22 UTC 2020


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 <bobn at rogers.com>:
> 
> 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
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/seaside/attachments/20200813/d7a3224a/attachment-0001.html>


More information about the seaside mailing list