Learning Drawing a page

Transparency

1.4 ch. 71.7 §11

Before 1.4, every paint operation fully covered what was underneath (the opaque "painter's model"). 1.4 added a full compositing model: each object has an opacity, a shape and a blend mode, and objects can be composited in groups before being combined with the backdrop.

% In resources: /ExtGState << /GS1 << /ca 0.5 /CA 0.5 /BM /Multiply >> >>
q
/GS1 gs                 % apply 50% opacity, Multiply blend
0 0 1 rg 100 100 200 200 re f
Q

Graphics state keys

These are keys in an ExtGState dictionary, applied with gs; no operator sets them.

KeyMeaning
/CA, /caConstant alpha for stroking (CA) and nonstroking, i.e. fill (ca)
/BMBlend mode
/SMaskSoft mask dictionary (alpha or luminosity from a group), or /None
/AISAlpha-is-shape flag
/TKText knockout

Blend modes

Separable (per channel): Normal, Multiply, Screen, Overlay, Darken, Lighten, ColorDodge, ColorBurn, HardLight, SoftLight, Difference, Exclusion.
Non-separable: Hue, Saturation, Color, Luminosity. Compatible behaves exactly like Normal: 1.7 says not to use it, and PDF 2.0 deprecates it.

PDF 1.4 gives formulas for some of these and only describes the rest. Adobe's 2006 blend-modes addendum to the PDF 1.6 Reference adds formulas for all of them, without changing how any mode behaves. The Blend modes reference has every formula.

Transparency groups

A form XObject with a /Group << /S /Transparency … >> entry is composited as a unit, then combined with the backdrop.

Isolated /I true
The group composites against a transparent backdrop instead of whatever is underneath.
Knockout /K true
Each element composites with the group's initial backdrop, not with earlier elements of the group. (A different /K from the structure-element /K.)
Page group
/Group on a page sets the blending color space for the page, for example /CS /DeviceCMYK for print.

Read: 1.4 ch. 71.7 §11

This is why PDF/A-1 and PDF/X-1a forbid transparency: they are based on 1.4, but chose the opaque subset for predictable output. PDF/A-2 (based on 1.7) allows it.
Q1. Which ExtGState key sets the opacity of fills?
/CA/ca/BM/SMask
Check
Q2. What does an isolated transparency group (/I true) composite its contents against?
A transparent backdropWhatever is already on the page beneath itThe group's first elementWhite
Check
Q3. Why do PDF/A-1 and PDF/X-1a forbid transparency?
They are based on PDF 1.3, before transparencyThey chose the opaque subset of PDF 1.4 for predictable outputTransparency invalidates digital signaturesPrinters can't reproduce transparency
Check
Reset3 questions

Section references such as 1.4 §3.4 1.7 §7.5 are to the Adobe PDF Reference, third edition (PDF 1.4) and ISO 32000-1:2008 (PDF 1.7). Where to get them: PDF specifications.