[cairo] Erro when converting txt file to pdf

Leonardo Ado leonardo_adoado at hotmail.com
Tue Dec 4 12:11:17 PST 2012

Good afternoon, I wrote a code in C++ in DEV-C++ using the CAIRO libray. This code is suposed do convert an existing txt file to pdf file.
I could compile the code correctly and create the exe file. The problem is that when I execute it, It happens this error message = process returned -1073741819 (0x0000005)  So, I do not understand. If there is no error when I compile, Why does this error happen when I execute the program?  And spite of the program exucute with error, the pdf file is created, but it is created corruped. I have searched everywhere looking for some solution, but I could not find it.  Someone told that the problem was the cairo library corruped, but I do not know if it is the real problem. Could you help me? Here is the code I am trying.

#include <cairo.h>
#include <cairo-pdf.h>
int main() {
    float position;
  cairo_surface_t *surface;
  cairo_t *cr;  surface = cairo_pdf_surface_create("file.pdf", 504, 648);  cr = cairo_create(surface);  position=50.0;
  cairo_move_to(cr, 8.0, position);
  cairo_show_text(cr, "This is line 1");
  cairo_move_to(cr, 8.0, position);
  cairo_show_text(cr, "This is line 2");
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo/attachments/20121204/110f8aa8/attachment.html>

More information about the cairo mailing list