<html><body bgcolor="#FFFFFF"><div><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); font-size: small; ">I have not looked a the Cairo code, so I do not know how it is currently implemented. But I have the following comments:<br><br>"DocumentProperties" MUST ALWAYS be called prior to using a DEVMODE structure with the GDI, to ensure a valid version including the private part. Or else the driver might just discard you changes, use whatever it sees fit or fail the job, depending on how forgiving the driver is (which most are, but don't count on it)<br>Also do not base any assumptions in your code on the setting you provide in the input DEVMODE, the driver might change change settings or fail the call to DocumentProperties depending on the printer capabilities. So if the printer/driver does not support landscape orientation, it might just change the output DEVMODE back to portrait. Always check the the returned DEVMODE.<br><br>Use the "GetDeviceCaps" function to get correct information like extends, margins, colors, pixel aspect ratio...<br><br>With "DeviceCapabilities" you can retrieve the number of degrees, the landscape orientation is rotated from portrait.<br><br>And some printer drivers accept JPEG or PNG directly, you can check for that with "ExtEscape"<br><br><br>If "GNU Win32 API" does not support DocumentProperties, then that is bad.<br><br>/christoph</span><br><br><div><br></div></div><div><br>On 22/02/2011, at 06.48, "Ian" <<a href="mailto:ian@underpressuredivers.com">ian@underpressuredivers.com</a>> wrote:<br><br></div><blockquote type="cite"><span>What I'm not sure of is how to fix it. I think that</span><br><span>cairo_win32_printing_surface_create() needs to swap the width/height when</span><br><span>the printer mode is landscape, but I can't find a way to get at that. I</span><br><span>think it is provided by the Windows API DocumentProperties() function, but</span><br><span>DocumentProperties is not supported in the GNU Win32 API.</span></blockquote><div></div></body></html>