Summary: | Cairo 1.4.0 generates invalid PDF files | ||
---|---|---|---|
Product: | cairo | Reporter: | Simon Ask Ulsnes <vinterbleg> |
Component: | pdf backend | Assignee: | Kristian Høgsberg <krh> |
Status: | RESOLVED INVALID | QA Contact: | cairo-bugs mailing list <cairo-bugs> |
Severity: | blocker | ||
Priority: | high | CC: | vinterbleg |
Version: | 1.4.0 | ||
Hardware: | x86 (IA32) | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
The correct PDF file.
Corrupt PDF file. Program to generate the PDF. |
Description
Simon Ask Ulsnes
2007-03-07 04:24:56 UTC
Created attachment 9011 [details]
The correct PDF file.
This file was generated by cairo-1.2.6.
Created attachment 9012 [details]
Corrupt PDF file.
This file was created by cairo-1.4.0.
Created attachment 9013 [details]
Program to generate the PDF.
Compile with: gcc -o test test.c -lcairo
Run with: ./test
Outputs test.pdf to the current directory.
Ok, it turns out it's necessary to explicitly cast the pointer to the surface created by cairo_pdf_surface_create to a cairo_surface_t*. This should not be necessary, since the return type of said function is cairo_surface_t*, but it appears to make a difference. Anyone care to explain? :-S - Simon Because you are on a x86_64 system, with sizeof(int)!=sizeof(void*), and you are not including cairo-pdf.h, so cairo_pdf_surface_create() is not prototyped and assumed to return an int. So you get the following warning: test.c: In function ‘main’: test.c:6: warning: initialization makes pointer from integer without a cast |
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.