Forum How do I...?

Questions on embeding to server

ilj@devex
Hi.

We need to render a bunch of xhtml files with css and some images to pdf from our Java server on Linux. Currently we are using CSS2XSLFO + Apache FOP for that. But we are not satisfied with this solution for two reasons:
- output is poorly formatted
- memory consumption is not reasonable

Output from trial version of Prince I downloaded is really better and closer to browser view of original html (just what we desire). And general performance (both memory and CPU) seems to be better than FOP's.

Thus, can you please clarify these points:
- what is the best approach to create a separate rendering component used from several other components, possibly creating multiple rendering threads (stdin/stdout, randomly named files, etc)
- is it possible to embed only font glyphs for characters used in the document and not embed the whole font
- how can we specify the margins (current margins are too big and content is sometimes too squeezed)
- is proportional column width supported, e.g.
<table>
<col width="1*"/>
<col width="1.5*"/>
<col width="3*"/>
<tbody>
<tr>
mikeday
Page margins can be specified with @page rules:
@page {
    margin-top: 2cm;
    margin-left: 1cm;
    ...
}

Prince will subset fonts when embedding and not include the entire font unless explicitly requested.

Proportional column width is not supported at this time.

If you're calling Prince from Java, try the Java API we provide, which makes it easy to run Prince on files or streams. Otherwise, there is always the command-line interface.