[dvipdfmx] improving color stack in xdvipdfmx

Shunsaku Hirata shunsaku.hirata74 at gmail.com
Thu Jun 25 23:08:32 CEST 2020


> If xdvipdfmx does the management then something like this
>
> \special{pdf:obj @pgfpattern [/Pattern/DeviceRGB]}
>
> \special{pdf:bcolor @pgfpattern [1.0 0.4 0]} .... \special{pdf:ecolor}
>
> should work and add the pattern to the ColorSpace resource, doesn't it?

It should work and dvipdfmx automatically adds a ColorSpace resource
and a Pattern resource to the current page's resource dictionary with
automatically assigned resource names as dictionary keys.
(The example above should be something like

   \special{pdf:bcolor @pgfpattern [1.0 0.4 0 @pattern_definition]}
.... \special{pdf:ecolor}

since a Pattern resource is also required for the "set color" PDF operator.)

> This would mean that pgf should adapt its backend code (and would need
> a way to identify the xdvipdfmx version).

Unless the new syntax is used, the old approach continues to work.
Furthermore I will consider some tricks so that both approaches can coexist.

Thanks,
Shunsaku Hirata


More information about the dvipdfmx mailing list.