[cairo] cairo_win32_printing_surface + no-print-out no-crash

dostojew at freenet.de dostojew at freenet.de
Thu Sep 17 02:02:10 PDT 2009


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
 
 

Heute schon ge"freeMail"t?
Jetzt kostenlose E-Mail-Adresse sichern!
http://email.freenet.de/dienste/emailoffice/produktuebersicht/basic/mail/index.html?pid=6831

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cairographics.org/archives/cairo/attachments/20090917/03b7ca30/attachment.htm 


More information about the cairo mailing list