DecodeAllStreams

Document properties, Optimisation

Description

Expands every plain FlateDecode stream of the selected document in place, so the saved file carries readable content streams, metadata and structure.

Syntax

Delphi

Function TPDFlib.DecodeAllStreams: Integer;

Return values

0No document is selected, or nothing could be expanded.
NThe number of streams expanded.

Remarks

Compressed object streams are materialised first so their members survive the expansion. Image XObjects keep their encoding (expanding them would balloon the file with no readability gain), as do streams with prediction parameters, multi-filter chains and cross-reference streams. Damaged data is left untouched rather than truncated.

Pair the call with SetObjectStreamMode(0) to keep every object at the top level, and the result is a fully expanded copy that diff tools, forensic review and support cases can read directly — the counterpart of RecompressStreams.

Example

PDF.LoadFromFile('packed.pdf', '');
PDF.DecodeAllStreams;
PDF.SetObjectStreamMode(0);
PDF.SaveToFile('expanded.pdf');

See also

RecompressStreams, SetObjectStreamMode, CompressContent, CheckDocumentStructure