API referenceGraphics

pdfSetTransparentColor

Set/get a document-global "transparent color" value.

C
BOOL32 __stdcall pdfSetTransparentColor(PPDF IPDF, uint32_t AColor);
uint32_t __stdcall pdfGetTransparentColor(PPDF IPDF);
Delphi
function pdfSetTransparentColor(const IPDF: PPDF; AColor: Cardinal): LongBool; stdcall;
function pdfGetTransparentColor(const IPDF: PPDF): Cardinal; stdcall;

Purpose. Set/get a document-global "transparent color" value.

Description. Verified write-only no-op, same class as pdfInitColorManagement above: pdfSetTransparentColor stores AColor into FTransparentColor (default $00FFFFFF, i.e. white) and always returns True if the document handle is valid; pdfGetTransparentColor faithfully reads it back. FTransparentColor has exactly these two read/write sites and is never consulted by image drawing, color-key masking (pdfSetColorMask above), or any other rendering path — setting it has no visible effect on output.

Parameters.

ParameterDescription
IPDFDocument handle.
AColor*(Set only)* Packed color value to store.

Return value. pdfSetTransparentColor: True if IPDF is valid (does not indicate any actual effect). pdfGetTransparentColor: the last stored value, or the $00FFFFFF default if never set; 0 if IPDF is invalid.

See also. pdfSetColorMask (the mechanism that actually does make image pixels transparent).

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Graphics
Category

Setters

Exported names

pdfSetTransparentColor

String variants

The …A form takes UTF-8, …W takes UTF-16; a bare name aliases the ANSI form.

See working code

Worked examples — complete programs in ten languages.