[cairo] long dash patterns

Simon Budig simon at budig.de
Wed May 13 02:56:03 PDT 2015

Tobias Preclik (cairo at tobias.preclik.de) wrote:
> I manually constructed an svg file and converted it with Inkscape and
> cairosvg to a PDF. The PDF looks as intended. However, printing it fails in
> various ways depending on the printer driver (empty page, wrong dash
> pattern). Converting the PDF file with pdf2ps reports an error:
>    **** Error reading a content stream. The page may be incomplete.
>    **** File did not complete the page properly and may be damaged.

for me pdf2ps also gave the following message:

   **** Warning: File has unbalanced q/Q operators (too many q's)

> Since Inkscape as well as cairosvg use Cairo I believe that Cairo might be
> the source of the problem.
> The error seems to be connected to the long dash array. Any ideas on your
> side what could be the problem?

I actually suspect that the error is with pdf2ps.

Using rsvg-convert I converted your svg to a pdf and saw the error
message mentioned above when using pdf2ps.

Decompressig the PDF and looking at the graphics operators did not show
an unbalanced use of q/Q and the definition of the dash array looks

I then did some experiments with the dash array definition within the
PDF operator stream, recompressed the PDF and converted it to ps with

It turns out that having more than 11 numbers in the stroke-dash array
yields the error mentioned above. Up to (including) 11 numbers
everything works fine.

Since I don't see a size restriction on the dash pattern in the PDF
specification I suspect that pdf2ps (respective the relevant printer
drivers) are at fault.

              simon at budig.de              http://simon.budig.de/

More information about the cairo mailing list