SaveChanges

Document management

Description

Appends changed objects to the file originally opened by LoadFromFile, preserving every original byte and adding a new incremental xref section

The method validates Password before writing, rejects a source whose length changed externally, then reloads the updated file so another call uses the latest source length and /Prev chain

The selected public document handle remains stable across the reload

Documents loaded from a stream or string have no original path and return zero

Syntax

Delphi

Function TPDFlib.SaveChanges(Const Password: WideString): Integer;

Parameters

PasswordThe password needed to reload an encrypted source, or an empty string for an unencrypted document

Return values

0The document is not file-backed, the password is wrong, the source changed externally or the append or reload failed
1The incremental update was appended and the updated document reloaded

See also

AppendToFile, AppendToStream, SaveToFile