[cairo] PDF surface questions

cu cairouser at yahoo.com
Wed Jun 22 16:26:32 PDT 2011

I've been experimenting with writing PDF surfaces. Some of the
operations use image surface sources to draw into specific areas of PDF
(think "sprites"/icons placed in PDF image). There are two issues I've
found with that:

1. It appears that even when using the same surface or pattern as
source, PDF file ends up with as many image copies of source as there
are icons it was used for. Big waste of space.

2. It appears that even if a small area of source is used (i.e. one icon
from a large icon set stored as a single surface) drawn into a small
rectangle, resulting PDF contains the complete image with a full icon set.

I wonder if it would be possible to avoid at least one of these cases -
i.e. if each icon must be stored as a separate image, than could it be
stored as an image of exact size as required to fill the area (I
understand that I could do this by creating individual images instead of
a single large source, but that's not acceptable for the rest of product
architecture) or, alternatively, keep a single copy of an image used
multiple times in PDF?

I am using Cairo 1.9.8

Thanks all,

More information about the cairo mailing list