When generating Mapnik vector map outputs with Cairo, and then converting the file to PostScript with pdf2ps, the convertor prints following message to output:
**** Error reading a content stream. The page may be incomplete.
**** Warning: Pattern stream has unbalanced q/Q operators (too many q's)
**** This file had errors that were repaired or ignored.
**** The file was produced by:
**** >>>> cairo 1.10.2 (http://cairographics.org) <<<<
**** Please notify the author of the software that produced this
**** file that it does not conform to Adobe's published PDF
The generated file can be downloaded from http://cozpserver2.jinonice.cuni.cz/~petr/download/MTB-vektor-export/Cairo-bug/BIG_export_A2.pdf
Thank you for your quick answer, that explained lot of my problems.
That is not quite pleasant behavior, when using certain format for it's vector features.
Is there any debug mode in which the fact, that Cairo is going to fallback is printed out? Or even better - can be the fallback mode controlled from the code (ie. forbidden or detected)?
(In reply to comment #2)
> That is not quite pleasant behavior, when using certain format for it's vector
Cairo is designed to produce the same output across all surfaces. If an operation is not supported it is rasterized. I'm not sure that there is any sensible alternative. Do you think it should ignore unsupported drawing operations or convert them to something that is supported but looks obviously different?
> Is there any debug mode in which the fact, that Cairo is going to fallback is
> printed out? Or even better - can be the fallback mode controlled from the code
> (ie. forbidden or detected)?
You can grep the PostScript for the 'Fallback' comment. The only way to avoid fallback images is to restrict yourself to drawing operations that are natively supported by surface you are using.
Sorry for responding to wrong bug in the first comment.
I have much control over the input stream as long as it is done by Mapnik.
It would be helpful if I could set fallback forbidden mode, in which the Cairo will throw exception when trying to paint unsupported feature.
There have been a lot of changes since 1.10.2 and there is no test case here for me to try. So I'm assuming it works now. Please reopen if it is still a problem.