API referenceCore SDK

pdfSetDecodeMode

Control whether pdfGetObjectToString ([Document Lifecycle, Locking, and Object Introspection](E11_DocumentLifecycleLockingAndObjectIntrospection.md)) returns a

C
int32_t __stdcall pdfSetDecodeMode(PPDF IPDF, int32_t NewDecodeMode);
Delphi
function pdfSetDecodeMode(const IPDF: PPDF; NewDecodeMode: Integer): Integer; stdcall;

Purpose. Control whether pdfGetObjectToString (Document Lifecycle, Locking, and Object Introspection) returns a stream object's filter-decoded payload or its raw serialized bytes.

Description. Real and directly wired: per an explicit source comment, "Consumed by GetObjectAsString: mode <> 0 -> pdfGetObjectToString returns the filter-decoded stream payload for stream objects (raw serialization at mode 0)." This is a genuinely useful low-level debugging/introspection toggle, not a no-op like several of this chapter's other document-global settings.

Parameters.

ParameterDescription
IPDFDocument handle.
NewDecodeMode0 = raw serialized bytes; non-zero = filter-decoded payload, for pdfGetObjectToString.

Return value. 1 if IPDF is valid; 0 otherwise.

See also. pdfGetObjectToString.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfSetDecodeMode(IntPtr IPDF, int NewDecodeMode);
Area
Core SDK
Category

Setters

Exported names

pdfSetDecodeMode

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.