[cairo] Out of memory when creating a large pdf

gnappen gnappen at gmail.com
Tue Jul 13 05:42:03 PDT 2010


I am trying to build a large ancestor tree in to a single page pdf with 
cairo. It consists of lines, circles and text for about 12000 
individuals. I know that the pdf format can handle it, as this ancestor 
tree has been done manually with Coral Draw. The pdf isn't that big in 
size, but it contains a large amount of objects in one single page.

When I get about halfways I get the CAIRO_STATUS_NO_MEMORY error.

I have tried cairo_pdf_surface_create_for_stream(), hoping to be more in 
control of how much is in memory, but I get the out of memory error from 
cairo before the callback is called.
The only way I've found so far to flush the buffer and avoid running out 
of memory is by calling cairo_show_page(). That will emit the data in 
the stream, but then I get a pdf with more than one page! :-(

Is there anyway of flushing the data from memory to the file without 
switching to a new page?
Or any other suggestions?

My enviroment is Win Vista, Visual C++, using Cairo binaries v1.8.10 
from GTK+.



More information about the cairo mailing list