THotPDF.RegisterBlackGenerationState Method
Registers an extended graphics state that carries the black-generation and undercolor-removal functions applied whilst converting DeviceRGB paint to DeviceCMYK, both by the HotPDF page renderer's own separation-plate conversion and by a downstream rip, and returns the resource name that THPDFPage.SetGraphicsState selects
Declaration
function RegisterBlackGenerationState(BG, UCR: THPDFObject;
BG2Default, UCR2Default: Boolean): AnsiString;
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
BG | Black-generation function dictionary, or nil to leave /BG2 out of the state |
UCR | Undercolor-removal function dictionary, or nil to leave /UCR2 out of the state |
BG2Default | Writes /BG2 /Default, which resets black generation to the function in force at the start of the page |
UCR2Default | Writes /UCR2 /Default, which resets undercolor removal the same way |
Return value
The generated ExtGState resource name, or an empty string when StrictVersionLock holds the document below PDF 1.3
Usage notes
- ISO 32000-1 10.3.4 requires both functions to be PDF function dictionaries in the graphics state, each called with a single numeric operand and returning a single numeric result; the black-generation function maps
[0.0 1.0]to[0.0 1.0]and the undercolor-removal function maps[0.0 1.0]to[-1.0 1.0], so a negativeRangeis expected on the removal side - Only the PDF 1.3 keys
/BG2and/UCR2are written, because Table 58 gives them precedence over/BGand/UCRin the same dictionary and the version gate has already established that the document is at least 1.3 - Passing a function together with the matching
Defaultflag raises, as does a call that supplies neither a function nor a flag, because the two meanings of one key contradict each other - Without
StrictVersionLockthe call raises the document version to PDF 1.3 the way every other 1.3 feature does; with the lock set it returns an empty string and writes nothing - Unlike RegisterTransferFunctionState, no
PDFACompliancesetting refuses this call: ISO 19005-2 and ISO 19005-3 oblige a conforming reader to ignoreBG,BG2,UCRandUCR2rather than forbid a writer from emitting them, whilst/TR,/TR2and/HTOare forbidden keys - Since v2.1204.1 the page renderer applies these functions during its own DeviceRGB to DeviceCMYK separation-plate conversion, following ISO 32000-1 10.3.4: it reads
/BG2before/BGand/UCR2before/UCR, treats the nameDefaultas the function in force at the start of the page, and with no function installed uses the identity pair, which reproduces the canonical conversion; the written entries still travel to the rip, printer or reader that consumes the file - Build the functions with RegisterSampledFunction or another function registration method, then select the returned state name with THPDFPage.SetGraphicsState before setting the colour the state should convert, because the renderer resolves a separation plate's coverage when the colour operator runs