[cairo] PDF device origin?
britten at caris.com
Thu Aug 14 08:25:54 PDT 2008
Behdad Esfahbod wrote:
>> Is the device origin of the PdfSurface in the lower-left corner, or
>> in the upper-left?
>> For some reason, my data is coming out upside-down :( I've been
>> assuming it was lower-left, but now I'm beginning to have doubts...
>> [ I'm pretty sure the user origin is always lower-left, independent
>> of the Surface type being used, eh? ]
> You're wrong. It's always upper-left.
Wow - That's unexpected... I had assumed some/all device origins
might be UL, but I guess I had thought the User space would be
Cartesian... (That'll teach me to assume, eh?)
>> On a related note, is there anything I can do with a
>> cairo_matrix_t to flip my data (Top-to-bottom, not left-to-right)
>> I didn't see any 'flip' type of functions available...
> cairo_scale (cr, 1, -1);
> You prolly also need a translate to the new origin before that.
Perfect! After a few of my own typos, etc, I was able to get my
data scaled/positioned correctly! Moving on... :)
More information about the cairo