[cairo] Cairo PDF

William Temperley willtemperley at gmail.com
Thu Jun 16 06:52:57 PDT 2011


On 16 June 2011 13:27, Adrian Johnson <ajohnson at redneon.com> wrote:
> On 16/06/11 21:10, William Temperley wrote:
>> Dear all,
>>
>> I've been embedding PNG images into PDFs using Cairo for a while via
>> the Java-Gnome bindings (and getting some great results, thanks!).
>>
>> After upgrading from Cairo 1.8.10 to 1.10.2, embedded PNGs appear
>> blurry in both Acrobat reader and Evince. (I'm now using Java-Gnome
>> 4.0.19 - before I was on 4.0.14).  The Java-Gnome developers say
>> nothing has changed WRT to image embedding from their side, so it is
>> likely this is down to a change in Cairo.
>>
>> This is best illustrated with maps produced the different libraries:
>>
>> With Cairo 1.8.10 (Java-Gnome 4.0.14):
>> http://www.map.ox.ac.uk/media/temp/DJI_Pf_PR.pdf
>>
>> With Cairo 1.10.2 (Java-Gnome 4.0.19):
>> http://www.map.ox.ac.uk/media/temp/DJI_cairo_1-10-2.pdf
>
> Cairo 1.10 PDF output sets the PDF interpolate flag for embedded images
> based on the filter set on the pattern using cairo_pattern_set_filter().
> The default filter causes the interpolate flag to be set to true.
>
> Your PDFs contain very low resolution images that are scaled up. With
> interpolate set to true you will get the blurry images. If you want the
> interpolation disabled, set the filter to CAIRO_FILTER_NEAREST.
>

Thanks Adrian, I'll give that a whirl.  Looks like I'll have to add
the binding to cairo_pattern_set_filter in Java-Gnome myself.

Will


More information about the cairo mailing list