function SaveAsObjectGraphPatched(Stream: TStream; const Operations: TPdfObjectPatchOperations; out Report: TPdfObjectGraphReport; AllowSignedDocument: Boolean = False): Boolean;
| Stream | TStream. Destination stream |
| Operations | TPdfObjectPatchOperations. Array of operations, each naming a Kind (popSet or popRemove), the target ObjectNumber and Generation, the dictionary Key, and for popSet a Value whose own Kind selects null, boolean, integer, real, name, text string, or reference |
| Report | TPdfObjectGraphReport. Receives PatchedObjectCount, AppliedOperationCount, byte counts, Succeeded, and ErrorMessage |
| AllowSignedDocument | Boolean. Permit rewriting a signed document. Defaults to False |
| Result | Boolean. True when the patched document was written |
function SaveAsObjectGraphPatched(const FileName: string; const Operations: TPdfObjectPatchOperations; out Report: TPdfObjectGraphReport; AllowSignedDocument: Boolean = False): Boolean;
| FileName | string. Destination file, written atomically through a temporary file in the same directory |
| Operations | TPdfObjectPatchOperations. Same operation list as the stream overload |
| Report | TPdfObjectGraphReport. Same report record |
| AllowSignedDocument | Boolean. Permit rewriting a signed document |
| Result | Boolean. True when the file was written |
Reaches entries that no typed API exposes - a private key in a catalogue dictionary, a viewer preference which PDFium does not model, a corrected entry in a damaged file - by naming the object and the key directly
AppliedOperationCount against the length of Operations shows whether every edit found its target; an operation naming an object which does not exist is reported rather than silently ignored
Rewriting a signed document invalidates its signatures, so that case is refused unless the caller opts in. Use ExportObjectGraph first to find the object numbers to patch