[cairo] Re: Embeding JPG in PDF

Behdad Esfahbod behdad at behdad.org
Wed Jan 10 17:47:41 PST 2007

On Thu, 2007-01-11 at 11:32 +1100, Andrew McRae wrote:
> On Wed, 2007-01-10 at 18:49 -0500, Behdad Esfahbod wrote:
> > On Wed, 2007-01-10 at 18:07 -0500, Andrew McRae wrote:
> > > 
> > > Getting higher resolution images into the PDF side has been
> > > brought up before - my previous patch to allow fallback
> > > resolution to be used for PDF image resolution was rejected,
> > > but I still don't see how the alternatives can give you better
> > > than 72 dpi images in PDF? 
> > 
> > The way it's supposed to work is using cairo_scale().  If it doesn't,
> > it's a bug.
> But the PDF backend still only stores the image in 72dpi, so

Yes and no.  Only if a fallback image is used.  If no fallback is used
(ie, all operations needed are supported by PDF), the image is embedded
as is, as embedded PNG.

> it seems what happens is that if you use cairo_scale, this will
> simply scale the image and lose the resolution?

In the case of fallback images, you should set the fallback resolution
on the PDF surface then.

> If you provide some sample code to show how to do it,
> I would be most appreciative...
> Cheers,
> AMc

"Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety."
        -- Benjamin Franklin, 1759

More information about the cairo mailing list