Bug 13344 - the win32 printing surface is not resizable
Summary: the win32 printing surface is not resizable
Status: RESOLVED NOTABUG
Alias: None
Product: cairo
Classification: Unclassified
Component: win32 backend (show other bugs)
Version: 1.5.2
Hardware: x86 (IA32) Windows (All)
: medium normal
Assignee: cairo-bugs mailing list
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-22 03:16 UTC by mehmet yasar
Modified: 2008-01-11 04:33 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description mehmet yasar 2007-11-22 03:16:00 UTC
Like PS or PDF surface the win32 printing surface should be resizable (with a function like cairo_win32_printing_surface_set_size).
Comment 1 Adrian Johnson 2008-01-11 04:33:31 UTC
The reason this function is not implemented is because cairo doesn't own the device you are printing to. It just translates the cairo API to GDI calls. It is the responsibility of the application to do all the setup of the Windows device. For example the application needs to call the StartDoc, EndDoc, StartPage, and EndPage functions. 

The recommended way to change the page size is to destroy the cairo_win32_printing surface, use the windows API to change the page size, then create a new cairo_win32_printing surface with the same device handle. This works because the printing surface does not store any document level state. All it does is store the drawing commands you call then when show_page is called or the surface is finished it calls the GDI drawing functions on the device handle you supply to draw the page.

The PS and PDF surfaces have set size because without those functions it would not be possible for an application to change the page size.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.