Erro when converting txt file to pdf

Leonardo Ado <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
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");
  position+=8;
  cairo_move_to(cr, 8.0, position);
  cairo_show_text(cr, "This is line 2");
  
  cairo_show_page(cr);
  
  cairo_surface_destroy(surface);
  
  cairo_destroy(cr);
}

-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.