PeachPDF

PeachPDF.PdfGenerateConfig

PdfGenerateConfig.PortableColorFilters Property

Whether CSS brightness(), contrast() and invert() (and an SVG feColorMatrix/feComponentTransfer that acts on each channel alone) are written as blend-mode layers every PDF reader composites itself, instead of as a PDF transfer function. Defaults to false.

public bool PortableColorFilters { get; set; }

Property Value

System.Boolean

Remarks

The default is a transfer function (an ExtGState /TR), which is exact for any content but which some readers ignore: MuPDF, and so the viewers and libraries built on it, draw the element unfiltered. With this on the element is filtered in every reader, but the result is exact only where the content is opaque. Where it is partly transparent (an rgba() colour, an antialiased edge) the colour is slightly off, because a blend mode over a partly transparent backdrop lets some of the layer’s own colour through. The output is still vector, and needs a reader that supports PDF transparency (so it is rejected under PDF/A-1 and PDF/X-1a/X-3, like the default is).