[Seaside] creating respons to feed into pdfcreator

a van schijndel avanschijndel at oxius.nl
Mon Jan 10 12:15:58 UTC 2011


Op maandag 10-01-2011 om 01:12 uur [tijdzone -0800], schreef Boris
Popov, DeepCove Labs:

> That code is primarily to render XHTML to a string and then feed it to PRDreactor for conversion to PDF; returning of the bytes in the response is using #respond: as expected. My latest version looks like the following at the moment,
> 
> Component>>asPDF
> 
> | xhtml |
> xhtml := (RenderCanvas builder)
> 		fullDocument: true;
> 		documentClass: WAHtmlDocument;
> 		rootBlock: 
> 			[:root |
> 			root beXhtml10Strict.
> 			root style add: (Styles default documentForFile: 'print.css').
> 			root style add: 'svg {-ro-replacedelement: ''com.realobjects.xml.formatters.SVGFormatter'';}'];
> 		render: [:html | html render: self].
> ^(PDFreactorClient default convertXHTML: xhtml) bytes
>  
> -Boris
> 

Thanks a lot Boris. That is exactly what I needed. I did a first quick
implementation and it works for me too. Have to look into my composition
of stylesheets to get it right. Maybe this code snippet can be added to
the PDF faq on seaside.st?

- 
Arthur

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20110110/057896bf/attachment.htm


More information about the seaside mailing list