Forum How do I...?

flush pdf content during big rendering

gaspard
My clients need to produce a single pdf made of several letters/invoices/etc. This makes thousands of pages and eat a lot of RAM during processing because everything is kept in memory.

Is there a way to tell Prince about the invoice boundaries so that it can flush the content to file ?

Something like -prince-flush-content:always ?

Gaspard
jim_albright
Is it possible to break the job into pieces and process the smaller pieces that you want to output?

Jim Albright
Wycliffe Bible Translators

gaspard
Yes, the invoices are all together to ease printing, but each of them is a self-contained element:

<div class='invoice'>
  ... invoice 1
</div>
<!-- FLUSH here -->
<div class='invoice'>
  ... invoice 2
</div>

etc.
jim_albright
How about sending one invoice at a time for printing then.

Jim Albright
Wycliffe Bible Translators

mikeday
At the moment we don't have any "streaming" option to save memory on large input documents like this. We do hope to reduce memory usage in future, and are investigating various approaches for doing so. At the moment the only workaround is to run Prince on a computer with more RAM, or chop up the input document, generate multiple PDF files, and stick them together again.
gaspard
Thanks for your replies,

mikeday wrote:
At the moment we don't have any "streaming" option to save memory on large input documents like this. We do hope to reduce memory usage in future, and are investigating various approaches for doing so.


We will increase the server's RAM then...

jim_albright wrote:
How about sending one invoice at a time for printing then.


The client wants to have a single file, it's not an option.