API referenceCore SDK

pdfSetDefBitsPerPixel

Set/get a document-global default color bit depth for

C
int32_t __stdcall pdfGetDefBitsPerPixel(PPDF IPDF);
BOOL32 __stdcall pdfSetDefBitsPerPixel(PPDF IPDF, int32_t Value);
Delphi
function pdfGetDefBitsPerPixel(const IPDF: PPDF): Integer; stdcall;
function pdfSetDefBitsPerPixel(const IPDF: PPDF; Value: Integer): LongBool; stdcall;

Purpose. Set/get a document-global default color bit depth for images/rendering operations that don't otherwise specify one.

Description. Verified write-only no-op. The setter does validate Value against the 4 legal depths (8/16/24/32 — "reject invalid depths," per an explicit DIFF source comment; an invalid value is silently ignored, prior value retained), but FDefBitsPerPixel (default 24) has no consumer anywhere beyond its own getter — no image-creation, canvas, or rendering code path reads it.

Parameters.

ParameterDescription
IPDFDocument handle.
ValueMust be 8/16/24/32 or the call is silently ignored (prior value retained); regardless, never consulted anywhere.

Return value. Getter: the stored value (default 24); 0 if IPDF invalid. Setter: True if IPDF valid.

C# (P/Invoke)

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

Setters

Exported names

pdfSetDefBitsPerPixel

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.