Re: Need help with gtkprint issues



On Wed, 2006-12-06 at 09:38 -0500, Dr. Michael J. Chudobiak wrote:
> 
> The big problem is that the images are being rendered at 72 dpi, when 
> printing to PDF, PS, or a real printer, which is really ugly.
> 
> Using cairo_surface_set_fallback_resolution doesn't seem to affect
> anything.

cairo_surface_set_fallback_resolution is irrelevant, because no fallback
is happening.  This was recently discussed on the cairo list too, all
you need to do is to cairo_scale() on your context.

For example, if you have a 1500x1100 image that you want to print into a
11"x8" paper:  11"x8" is 792x576 points (point is the device unit for
PS/PDF surfaces).  So, you need to map two image pixels to one device
unit, or in other words, map each image unit to .5 PDF units.
cairo_scale (cr, .5, .5) before cairo_set_source_surface() should do
that.

-- 
behdad
http://behdad.org/

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






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]