Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#44200 - [mapnik] Export to PDF fails

Attached to Project: Community Packages
Opened by Roel (roelpaddestoel) - Sunday, 15 March 2015, 20:55 GMT
Last edited by Sergej Pupykin (sergej) - Monday, 23 March 2015, 11:40 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sergej Pupykin (sergej)
Architecture x86_64
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

When trying to render a map in python, I get the following error:

File "./hikingmap.py", line 254, in render_map
mapnik.render_to_file(m, filename, 'pdf')
RuntimeError: Cairo backend not available, cannot write to format: pdf

The error happens only when rendering to pdf, ps or svg, jpeg and png work fine. The following piece of code is an excerpt from mapnik_python.cpp, line 489-496:

else if (format == "pdf" || format == "svg" || format =="ps" || format == "ARGB32" || format == "RGB24")
{
#if defined(HAVE_CAIRO)
mapnik::save_to_cairo_file(map,filename,format,1.0);
#else
throw mapnik::ImageWriterException("Cairo backend not available, cannot write to format: " + format);
#endif
}

This suggest that HAVE_CAIRO was not defined at compile time for some reason. I suppose the answer can be found in the build log, which I am unable to find on the archlinux website.

Additional info:
* version: mapnik-2.2.0.654.g718a8b3-1

Reproducing this bug is not that easy as it requires a complete setup, but calling mapnik.render_to_file in python with 'pdf' as third parameter should do the trick.
This task depends upon

Closed by  Sergej Pupykin (sergej)
Monday, 23 March 2015, 11:40 GMT
Reason for closing:  Fixed
Comment by Sergej Pupykin (sergej) - Tuesday, 17 March 2015, 18:45 GMT
please try mapnik-2.2.0.654.g718a8b3-3
it say that cairo found and -DHAVE_CAIRO is present in build log

Loading...