[cairo] PDF backend generates images that gs can't display etc

Arjen Nienhuis a.g.nienhuis at gmail.com
Thu Feb 25 13:23:27 PST 2010


On Thu, Feb 25, 2010 at 7:22 PM, Carl Worth <cworth at cworth.org> wrote:
> On Sat, 20 Feb 2010 01:07:50 +0100, Arjen Nienhuis <a.g.nienhuis at gmail.com> wrote:
>> Solution 1: An api to create v1.2 PDFs
>> - Cairo would be compatible with 99% of all pdf viewers and almost
>> compatible with PDF/A
>> - A lot of RIPs and PDF tools used in the printing industry don't
>> really support PDF 1.4. This is very specialized software (and
>> expensive) and cannot be upgraded.
>
> Yes. Targeting a particular PDF version makes a lot of sense if there
> are users that really need this. See cairo_ps_surface_restrict_to_level
> for some very similar API in cairo's PostScript backend.
>
> Anyone motivated to tackle that? (It's really just a matter of inserting
> a bunch of CAIRO_STATUS_UNSUPPORTED returns at the right places to
> trigger fallbacks for things not supported in PDF 1.2).
>

I'll do it. Can someone promise to at least look at my work when I'm done?

>> Solution 2: An api to disable masks and use fallbacks.
>> - Solves all problems for many viewers including acrobat 6, 7, 8 and
>> ghostscript.
>
> Right. This is what I imagined when I said "we don't currently have API
> to workaround viewer bugs". This would only be needed if users didn't
> find solution 1 adequate for some reason.

I'd be happy with solution 1.

>
>> Solution 3: Output all masks as white masks.
>> - Acrobat v7 works if the masks are white. I don't know why.
>
> This one doesn't make sense to me at all. How can it be interesting to
> generate a mask other than what was actually requested? (Or maybe I
> misunderstood the idea here.)
>

A mask has a color and a opacity. The color should be ignored, but it
is not. (This is as seen from the cairo api point of view. I didn't
check the PDF itself.)

So:

ctx.set_source_rgba(1,1,1,0.5)
...
ctx.mask()

works. But:

ctx.set_source_rgba(0,0,0,0.5)
...
ctx.mask()

doesn't. But never mind. I'll make PDF 1.2 support.

Groeten, Arjen


More information about the cairo mailing list