[cairo] Bug: SurfacePattern is rasterized when using EXTEND_REPEAT on PDF.

Simon Sapin simon.sapin at kozea.fr
Wed Jan 11 10:34:46 PST 2012


I have a bug in WeasyPrint (converts web documents to PDF): repeated SVG 
backgrounds are rasterized. (They appear as pixels instead of vectors.)

The source of the bug is in cairo or Pycairo. When a vector-type surface 
(PDFSurface or SVGSurface) is used as a source through a SurfacePattern 
and that pattern has EXTEND_REPEAT, the pattern is rasterized.

Attached is a test case that uses Pycairo to create an 'output.pdf' file 
in the current directory. When zoomed in a PDF viewer, the line on the 
left (not repeated) is in nice crips vectors, while the one on the right 
(with EXTEND_REPEAT) is in blurry pixels.

I had a quick look I’m not very familiar with cairo’s code base. In 
which file is EXTEND_REPEAT implemented? Would this be hard to solve?

Simon Sapin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: surfacepattern_test.py
Type: text/x-python
Size: 462 bytes
Desc: not available
URL: <http://lists.cairographics.org/archives/cairo/attachments/20120111/87adcc54/attachment.py>

More information about the cairo mailing list