CompactDocumentMemory

Memory management, temporary files, performance

Description

Re-encodes the selected document and moves large serialized indirect objects into the temporary file configured by SetTempFile

Syntax

Delphi

Function TPDFlib.CompactDocumentMemory: Integer;

Return values

1The document was compacted successfully
0No temporary file was configured or an object could not be materialized or serialized

Remarks

Call SetTempFile before this method and optionally use SetTempFileQuota to bound disk use

Spool entries are indexed by object number and generation for logarithmic lookup and remain readable after the write handle closes

If the quota is reached, affected objects remain in memory and the method can still succeed