[cairo] cairo_win32_printing_surface + no-print-out no-crash
Dominic Lachowicz
domlachowicz at gmail.com
Thu Sep 17 03:59:59 PDT 2009
Hi,
You still need to call StartDoc/StartPage/EndPage/EndDoc in the right
places. The printing surface (as opposed to the "normal" win32 surface)
merely outputs high-quality GDI-based vector drawing commands as much as
possible. Interacting with the printer is still the caller's responsibility.
Best,
Dom
On Thu, Sep 17, 2009 at 5:02 AM, <dostojew at freenet.de> wrote:
> Hello,
>
>
>
> I want to use the cairo_win32_printing_surface to get printing working
> under windows. I don't get any error message, although cairo_status is
> success, but the printer is doing nothing.
>
> I tried the following code:
>
>
>
> #include <cairo-win32.h>
>
> int main(int argc, char *argv[])
> {
> HDC hDC;
> cairo_t *cr;
> cairo_surface_t *surface;
>
> hDC = CreateDC ("WINSPOOL", "EDV", NULL, NULL);
> surface = cairo_win32_printing_surface_create (hDC);
> cr = cairo_create (surface);
>
> cairo_select_font_face (cr, "Sans", CAIRO_FONT_SLANT_NORMAL,
> CAIRO_FONT_WEIGHT_BOLD);
> cairo_set_font_size (cr, 12.0);
>
> cairo_move_to (cr, 10.0, 135.0);
> cairo_show_text (cr, "Hello");
> cairo_show_page (cr);
>
> printf ("%s\n", cairo_status_to_string (cairo_surface_status
> (surface)));
> cairo_surface_destroy (surface);
> cairo_destroy (cr);
>
> DeleteDC(hDC);
>
> return 0;
> }
>
>
>
> Is there simply something missing or am I doing something wrong?
>
> I use Cairo-1.8.8-2 on windows-XP-system whith Dev-c++ and Mingw
>
> The Device-Context I get from CreateDC is ok, because when I use StartDoc
> the Printer begins to print.
>
>
>
> Has anyone an idea?
>
> Thank's for your help
>
>
>
>
>
> --
> <http://adserver.freenet.de/click.ng/site=fn&affiliate=fn_mail&prod=fn_mail&tbl=webmail&ppos=14&rgtg=256&TransactionID=1253178130169236>
>
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo
>
--
"I like to pay taxes. With them, I buy civilization." -- Oliver Wendell
Holmes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cairographics.org/archives/cairo/attachments/20090917/8d5f6cf8/attachment.html
More information about the cairo
mailing list