API referenceImport & Output APIs

pdfSetUseObjectStreams

Emit the document with PDF 1.5 object streams and a

Purpose — Emit the document with PDF 1.5 object streams and a cross-reference stream instead of a classic xref table.

Description — When enabled, pdfCloseFile serializes normally and then repacks eligible non-stream objects into /ObjStm compressed object streams with an /XRef stream trailer — a noticeably smaller file for dictionary-heavy documents. Set it any time before close. Readers must support PDF 1.5+ (all modern viewers do).

C
BOOL32 __stdcall pdfSetUseObjectStreams(PPDF IPDF, BOOL32 Value);

Return valueTRUE unless the instance handle is invalid.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Import & Output APIs
Category

Setters

Exported names

pdfSetUseObjectStreams

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.