API referenceCore SDK

pdfOptimize

Run document-size optimization (e.g. removing unused objects,

C
BOOL32 __stdcall pdfOptimize(PPDF IPDF, TOptimizeFlags Flags, POptimizeParams Parms);
Delphi
function pdfOptimize(const IPDF: PPDF; Flags: TOptimizeFlags; Parms: POptimizeParams): LongBool; stdcall;

Purpose. Run document-size optimization (e.g. removing unused objects, deduplicating resources) per Flags.

Description. Flags is real and reaches OptimizeDoc. Parms — a struct presumably carrying fine-grained optimization thresholds/options — is accepted by the ABI but never passed through; whatever detailed tuning the struct's fields imply has no effect regardless of its contents.

Parameters.

ParameterDescription
IPDFDocument handle.
FlagsOptimization flag set; genuinely consulted.
ParmsAccepted but silently dropped — has no effect.

Return value. True if IPDF is valid; False otherwise.

C# (P/Invoke)

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

Core

Exported names

pdfOptimize

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.