FPdfCompress contains the public stream transformers used after PDFium serializes a document, plus records that configure each transformer and report its result
The full-rewrite helpers materialize the active object graph, preserve or deliberately rebuild cross-references, and reject inputs that cannot be rewritten safely; report-based procedures return failures through Succeeded and ErrorMessage
Most applications use the corresponding TPdf save, inspection, or object-graph methods, while the unit procedures remain available for callers that already own serialized PDF streams
TPdfTreeEditor = class
class function TryLoad(Source: TStream; Kind: TPdfTreeKind;
const RootReference: TPdfTreeObjectReference;
const Options: TPdfTreeEditOptions; out Editor: TPdfTreeEditor;
out Report: TPdfTreeValidationReport): Boolean; static;
class function Load(Source: TStream; Kind: TPdfTreeKind;
const RootReference: TPdfTreeObjectReference;
const Options: TPdfTreeEditOptions): TPdfTreeEditor; static;
function UpsertName(const Key, RawValue: AnsiString): Boolean;
function UpsertNumber(Key: Int64; const RawValue: AnsiString): Boolean;
function RemoveName(const Key: AnsiString): Boolean;
function RemoveNumber(Key: Int64): Boolean;
procedure Clear;
function Validate(out Report: TPdfTreeValidationReport): Boolean;
function BuildBalancedObjects(out Objects: TPdfTreeSerializedObjects;
out Report: TPdfTreeValidationReport): Boolean;
function SaveIncremental(Source, Dest: TStream;
out Report: TPdfTreeValidationReport): Boolean;
property Count: Integer;
property Entries[Index: Integer]: TPdfTreeEntry; default;
end;
TPdfOutlineEditor = class
class function TryLoad(Source: TStream;
const Options: TPdfOutlineEditOptions; out Editor: TPdfOutlineEditor;
out Report: TPdfOutlineValidationReport): Boolean; static;
class function Load(Source: TStream;
const Options: TPdfOutlineEditOptions): TPdfOutlineEditor; static;
function Add(ParentId, SiblingIndex: Integer; const Title: WideString;
PageNumber: Integer): Integer;
function Delete(Id: Integer): Boolean;
function Move(Id, NewParentId, SiblingIndex: Integer): Boolean;
procedure SetTitle(Id: Integer; const Title: WideString);
procedure SetStyle(Id: Integer; const Style: TPdfOutlineStyle);
procedure SetExpanded(Id: Integer; Expanded: Boolean);
procedure SetColor(Id: Integer; Red, Green, Blue: Single);
procedure ClearColor(Id: Integer);
procedure Retarget(Id, PageNumber: Integer;
const DestinationSuffix: AnsiString = '/Fit';
DestinationInAction: Boolean = False);
function ApplyPageMap(const NewPageNumbers: array of Integer;
DeleteDangling: Boolean; out Report: TPdfOutlineValidationReport): Boolean;
function Validate(out Report: TPdfOutlineValidationReport): Boolean;
function SaveIncremental(Source, Dest: TStream;
out Report: TPdfOutlineValidationReport): Boolean;
property Count: Integer;
property Items[Index: Integer]: TPdfOutlineItem; default;
end;
TPdfCrossDocumentGraftMap = class
constructor Create(const SourceIdentity: AnsiString);
procedure Clear;
function TryResolve(const Source: TPdfGraftObjectReference;
out Destination: TPdfGraftObjectReference): Boolean;
procedure Add(const Source, Destination: TPdfGraftObjectReference);
property Count: Integer;
property Entries[Index: Integer]: TPdfGraftMapEntry; default;
property SourceIdentity: AnsiString;
end;
TPdfSparseDictionaryReader = class
constructor Create(Source: TStream);
function ReadDictionary(ObjectNumber, Generation: Integer;
out Dictionary: AnsiString): Boolean;
function ReadLatestDictionary(ObjectNumber: Integer;
out Generation: Integer; out Dictionary: AnsiString): Boolean;
function ReadDecodedStream(ObjectNumber, Generation,
MaximumDecodedBytes: Integer; out Data: TBytes): Boolean;
property Valid: Boolean;
end;
procedure CompressPdfStream(Source, Dest: TStream);
procedure LinearizePdfStream(Source, Dest: TStream);
procedure PackPdfObjectStreams(Source, Dest: TStream;
MaxObjectsPerStream: Integer = 100;
MaxDecodedBytesPerStream: Integer = 65536);
procedure NormalizePdfDocumentContent(Source, Dest: TStream;
const Options: TPdfContentNormalizeOptions;
out Report: TPdfContentNormalizeReport);
function GraftPdfAcroForm(Source, Destination, Output: TStream;
const PageMappings: TPdfGraftPageMappings;
const Options: TPdfAcroFormGraftOptions;
GraftMap: TPdfCrossDocumentGraftMap;
out Report: TPdfAcroFormGraftReport): Boolean;
procedure PruneUnreachablePdfStream(Source, Dest: TStream;
out Report: TPdfPruneReport);
procedure PruneUnusedPdfResources(Source, Dest: TStream;
out Report: TPdfResourcePruneReport;
AllowSignedDocument: Boolean = False);
procedure DeduplicateResourcesPdfStream(Source, Dest: TStream;
out Report: TPdfDedupReport);
procedure RecompressFlatePdfStream(Source, Dest: TStream;
const Options: TPdfFlateRecompressOptions;
out Report: TPdfFlateRecompressReport);
procedure ExternaliseInlineImagesPdfStream(Source, Dest: TStream;
const Options: TPdfInlineImageExternaliseOptions;
out Report: TPdfInlineImageExternaliseReport);
procedure ReproduciblePdfStream(Source, Dest: TStream;
out Report: TPdfReproducibleReport);
procedure AppendPdfDirtyRevision(BaselineState, CurrentState,
PreviousOutput, Dest: TStream; out ChangedObjectCount: Integer;
out AppendedByteCount: Int64);
procedure ApplyDefaultOpenAction(Source, Dest: TStream;
PdfVersion: Integer = 0);
procedure PageLabelledPdfStream(Source, Dest: TStream;
const Ranges: TPdfPageLabelRanges; ReplaceExisting: Boolean;
out Report: TPdfPageLabelReport);
procedure InspectOptionalContentPdfStream(Source: TStream;
Usage: TPdfOptionalContentUsage; ConfigurationIndex: Integer;
out Inventory: TPdfOptionalContentInventory);
procedure ConfigureOptionalContentPdfStream(Source, Dest: TStream;
const Changes: TPdfOptionalContentStateChanges;
const Options: TPdfOptionalContentConfigureOptions;
out Report: TPdfOptionalContentConfigureReport);
procedure SanitiseActiveContentPdfStream(Source, Dest: TStream;
const Options: TPdfSanitiseOptions;
out Report: TPdfSanitiseReport);
procedure SanitiseActiveContentPdfStream(Source, Dest,
PruneWorkspace: TStream; const Options: TPdfSanitiseOptions;
out Report: TPdfSanitiseReport);
procedure ExportPdfObjectGraph(Source, Dest: TStream;
const Options: TPdfObjectGraphInspectOptions;
out Report: TPdfObjectGraphReport);
procedure PatchPdfObjectGraph(Source, Dest: TStream;
const Operations: TPdfObjectPatchOperations;
out Report: TPdfObjectGraphReport;
AllowSignedDocument: Boolean = False);
procedure PostProcessSavedPdf(Source, Dest: TStream;
PdfVersion: Integer = 0);
procedure PostProcessSavedPdf(Source, Dest, NormalizedWorkspace,
RepairedWorkspace, ValidationWorkspace: TStream;
PdfVersion: Integer = 0);
procedure RepairSubsetToUnicodeCMaps(Source, Dest: TStream);
function ReadPdfVersionInfo(Source: TStream; out Info: TPdfVersionInfo;
out ErrorText: string): Boolean;
function ReadPdfSparseRevisionInfo(Source: TStream;
out Info: TPdfSparseRevisionInfo): Boolean;
function ComposePdfSparseUpdateId(Source: TStream;
const Info: TPdfSparseRevisionInfo;
const DocumentId, InstanceId: TBytes): AnsiString;
function ReadPdfSparseCatalogSubDict(Source: TStream;
const Name: AnsiString; out SubDict: AnsiString): Boolean;
function ReadPdfSparsePageDictionaries(Source: TStream;
out Pages: TPdfSparsePageDictionaries): Boolean;
| Callable | Description |
|---|---|
TPdfTreeEditor.TryLoad | Loads and validates one indirect NameTree or NumberTree through sparse exact-generation lookup, returning structural evidence without raising for malformed input |
TPdfTreeEditor.Load | Loads one tree and raises an exception with the validation error when the structure is not safe to edit |
TPdfTreeEditor.UpsertName and UpsertNumber | Insert or replace one sorted entry while preserving its complete raw PDF value, including indirect references and compound objects |
TPdfTreeEditor.RemoveName, RemoveNumber, and Clear | Remove selected entries or empty the tree before deterministic rebalancing |
TPdfTreeEditor.Validate | Checks key ordering, duplicate keys, raw values, entry limits, and current editor invariants |
TPdfTreeEditor.BuildBalancedObjects | Builds bounded leaf and internal nodes with exact /Limits, retains the root identity, and reuses compatible loaded indirect node references where possible |
TPdfTreeEditor.SaveIncremental | Appends the balanced objects as a verified incremental revision and independently reloads the result before reporting success |
TPdfOutlineEditor.TryLoad and Load | Read an outline hierarchy through sparse exact-generation lookup, validate parent and sibling links, detect cycles, and preserve unsupported destinations and actions as opaque dictionary entries |
TPdfOutlineEditor.Add, Delete, and Move | Edit complete outline subtrees by stable item identifiers while maintaining depth-first sibling order |
TPdfOutlineEditor.SetTitle, SetStyle, SetExpanded, SetColor, and ClearColor | Update visible outline presentation without discarding unrecognised item dictionary entries |
TPdfOutlineEditor.Retarget | Assigns a one-based explicit page destination as direct /Dest data or a GoTo action with a validated destination suffix |
TPdfOutlineEditor.ApplyPageMap | Consumes the one-based destination mapping produced by page-plan validation, updates surviving explicit destinations, and either removes dangling subtrees or reports them |
TPdfOutlineEditor.SaveIncremental | Rebuilds root, parent, sibling, child, count, style, colour, and destination entries, appends an incremental revision, and independently reloads the semantic result before success |
TPdfCrossDocumentGraftMap.Create | Binds reusable source-to-destination indirect-object mappings to one caller-supplied source identity |
TPdfCrossDocumentGraftMap.Add and TryResolve | Store and resolve exact object-number and generation pairs, accept identical repeats, and reject conflicting destinations |
GraftPdfAcroForm | Imports field hierarchies, widgets, appearances, calculation order, default resources, actions, and values into mapped destination pages, appends a sparse incremental revision, and independently reloads the result before success |
CompressPdfStream | Flate-compresses eligible uncompressed streams and rebuilds the serialized PDF structure |
LinearizePdfStream | Reorders and renumbers the active object graph into linearized PDF layout with first-page and shared-object hint data |
PackPdfObjectStreams | Packs eligible non-stream objects into bounded ObjStm groups and writes a cross-reference stream; both grouping limits must be positive |
NormalizePdfDocumentContent | Normalizes every page content sequence with TPdfContentNormalizeOptions and returns a document-level TPdfContentNormalizeReport |
PruneUnreachablePdfStream | Rewrites only objects reachable from the catalog into one classic revision while preserving surviving object numbers and generations |
PruneUnusedPdfResources | Scans decoded content operators in page, inherited, Form XObject, pattern, appearance, and nested resource scopes, removes only unused resource names, appends a sparse revision, and prunes objects made unreachable |
DeduplicateResourcesPdfStream | Prunes unreachable objects and merges byte-identical font, image, and form XObject subgraphs |
RecompressFlatePdfStream | Decodes and recompresses reachable FlateDecode streams when both requested saving thresholds are met |
ExternaliseInlineImagesPdfStream | Moves inline image blocks into image XObjects, updates page resources, and rewrites affected content streams |
ReproduciblePdfStream | Produces deterministic single-revision output by pruning unreachable objects, removing Info timestamps, and omitting the source /ID |
AppendPdfDirtyRevision | Compares baseline and current semantic snapshots, appends changed or new indirect objects to the previous output, and reports appended counts |
AppendEncryptedPdfDirtyRevision | Appends changed or new indirect objects under the inherited encryption context and validates or renews revision authentication |
ApplyDefaultOpenAction | Injects a first-page Fit-Height open action when none exists and the selected PDF version permits it, using bounded stream windows and sparse lazy lookup across classic, xref-stream, hybrid, and object-stream revisions |
PageLabelledPdfStream | Writes a catalog /PageLabels number tree from zero-based ranges and optionally replaces an existing tree, using bounded stream windows and sparse catalog lookup on the normal xref path |
InspectOptionalContentPdfStream | Reads optional-content groups, configurations, memberships, usage metadata, and effective visibility into an inventory |
ConfigureOptionalContentPdfStream | Applies requested group visibility to a selected configuration and writes the required optional-content updates |
SanitiseActiveContentPdfStream | Strips selected catalog and trailer active-content entries through sparse lookup and bounded range copying, then can prune objects made unreachable by that removal; the workspace overload accepts caller-owned bounded or disk-backed storage for the prune input |
ExportPdfObjectGraph | Serializes bounded indirect-object data as pdf-object-graph-v1 JSON with optional encoded-stream SHA-256 digests |
PatchPdfObjectGraph | Sets or removes top-level dictionary entries by object identity and appends a verified incremental revision |
PostProcessSavedPdf | Runs default-open-action handling, version-specific normalization, and native incremental xref-stream repair; the overload with three distinct seekable workspaces lets callers apply their own bounded or disk-backed storage policy |
RepairSubsetToUnicodeCMaps | Rewrites subset-font ToUnicode CMaps whose array elements contradict their bfchar entries, using equal-length in-place element edits (bfchar values win, a pair differing only in the high bit resolves to the smaller code point, any other conflict keeps the first mapping); documents without /ToUnicode or with xref-stream, hybrid, or object-stream layouts pass through untouched, and every full non-incremental TPdf save applies the same repair automatically |
ReadPdfVersionInfo | Reads header, catalog override, effective core version, and Adobe developer-extension information |
ReadPdfSparseRevisionInfo | Reads bounded latest-revision facts, catalog bytes, object generations, xref style, encryption state, document identifiers, and tagged-structure evidence through the sparse object index |
ComposePdfSparseUpdateId | Formats an incremental trailer /ID by preserving caller or source identifiers and deriving missing values through a bounded streaming digest |
ReadPdfSparseCatalogSubDict | Reads a direct or indirect catalog sub-dictionary, such as MarkInfo or ViewerPreferences, through the sparse object index |
ReadPdfSparsePageDictionaries | Traverses the active page tree through sparse classic, xref-stream, hybrid, and object-stream lookup and returns page dictionaries in page order |
TPdfSparseDictionaryReader.Create | Builds one reusable sparse index over a caller-owned source stream and reports initialization success through Valid; the source must remain alive while the reader is used |
TPdfSparseDictionaryReader.Destroy | Releases the retained index buffers without freeing the caller-owned source stream |
TPdfSparseDictionaryReader.ReadDictionary | Resolves one exact object number and generation through the retained index and returns bounded active dictionary bytes |
TPdfSparseDictionaryReader.ReadLatestDictionary | Resolves the active xref entry for an object number, returns its generation, and reads its dictionary through the retained index |
TPdfSparseDictionaryReader.ReadDecodedStream | Reads and decodes one direct unfiltered or single FlateDecode stream while enforcing MaximumDecodedBytes |
TPdfOptionalContentConfigureOptions.Default | Selects configuration 0 and View usage, removes automatic-state rules, and enforces radio groups |
TPdfSanitiseOptions.Default | Enables open-action, catalog-action, name-tree, associated-file, and unreachable-object removal while preserving AcroForm and metadata |
TPdfObjectGraphInspectOptions.Default | Returns limits of 100000 objects, depth 32, 64 MiB output, 1 MiB strings, and enabled stream digests |
| Type | Description |
|---|---|
TPdfTreeKind | Selects a byte-sorted NameTree with ptkName or a signed 64-bit NumberTree with ptkNumber |
TPdfTreeObjectReference | Identifies one indirect tree node by ObjectNumber and Generation |
TPdfTreeEntry | Stores NameKey or NumberKey plus one normalized complete PDF object in RawValue; TPdfTreeEntries is its dynamic array |
TPdfTreeEditOptions | Bounds MaxEntries, MaxNodes, MaxDepth, MaxLeafEntries, and MaxKidsPerNode; Default supplies conservative production limits |
TPdfTreeValidationIssue | One issue carrying object evidence and diagnostic Message; TPdfTreeValidationIssues is its dynamic array |
TPdfTreeValidationIssueKind | Issue values ptviInvalidRoot, ptviUnreadableNode, ptviCycle, ptviDepthLimit, ptviNodeLimit, ptviEntryLimit, ptviInvalidNodeShape, ptviInvalidKey, ptviInvalidValue, ptviInvalidLimits, ptviDuplicateKey, ptviUnsortedKey, and ptviDeadlineExceeded |
TPdfTreeValidationReport | Reports NodeCount, EntryCount, MaximumDepth, Issues, object evidence, success state, and error text |
TPdfTreeSerializedObject | Contains one balanced node reference, complete indirect-object data, and whether the reference was reused |
TPdfTreeEditor | Mutable sorted tree model that preserves opaque PDF values and emits a balanced indirect hierarchy |
TPdfOutlineStyleFlag | Presentation values posItalic and posBold; TPdfOutlineStyle is their set |
TPdfOutlineObjectReference | Identifies a retained outline object by object number and generation |
TPdfOutlineItem | Stores stable identity, parent identity, title, explicit destination, action form, IsOpen, style, HasColor, ColorRed, ColorGreen, ColorBlue, and retained object reference; TPdfOutlineItems is its dynamic array |
TPdfOutlineEditOptions | Bounds MaxItems and hierarchy depth, with conservative defaults supplied by Default |
TPdfOutlineValidationIssueKind | Issue values poviNone, poviInvalidCatalog, poviUnreadableItem, poviCycle, poviDepthLimit, poviItemLimit, poviInvalidParent, poviInvalidSibling, poviMissingTitle, poviInvalidDestination, poviInvalidPageMap, poviEncryptedInput, poviWriteFailure, and poviVerificationFailure |
TPdfOutlineValidationReport | Reports IssueKind, object evidence, ItemCount, MaximumDepth, RemappedDestinationCount, RemovedDanglingItemCount, success state, and error text |
TPdfOutlineEditor | Mutable depth-first outline model with verified page-plan remapping and incremental persistence |
TPdfGraftObjectReference | Identifies one source or destination indirect object by exact object number and generation |
TPdfCrossDocumentGraftMap | Reusable source-identity-bound object map backed by TPdfGraftMapEntries that preserves cycles and shared references and rolls back entries added by a failed graft |
TPdfGraftPageMapping | Maps one-based SourcePageNumber to one-based DestinationPageNumber for widget /P and page /Annots updates |
TPdfAcroFormCollisionPolicy | Selects pagcpReject or pagcpRename when a source root field title collides with a destination root field title |
TPdfAcroFormGraftOptions | Controls CollisionPolicy, RenamePrefix, object and recursion budgets, and AllowSignedDestination |
TPdfAcroFormGraftReport | Reports SourceFieldCount, GraftedFieldCount, ReusedObjectCount, DestinationFieldCount, MappedPageCount, GraftedObjectCount, RenamedFieldCount, output size, success state, and error text |
TPdfVersionInfo | Version report with HeaderVersion, CatalogVersion, CoreVersion, AdobeBaseVersion, AdobeExtensionLevel, HasCatalogVersion, HasDeveloperExtensions, and HasAdobeExtension |
TPdfSparseRevisionInfo | Latest-revision snapshot with RootObjectNumber, RootGeneration, InfoObjectNumber, InfoGeneration, SizeValue, MaximumObjectNumber, PreviousXrefOffset, UsesXrefStream, HasEncrypt, HasDocumentId, HasTaggedStructure, FirstDocumentId, CatalogDictionary, and InfoDictionary |
TPdfSparseUpdateObject | One revision entry with ObjectNumber, Generation, and a complete Data body carrying N G obj ... endobj bytes |
TPdfSparseUpdateObjects | Dynamic array of TPdfSparseUpdateObject entries appended by AppendPdfSparseUpdate |
TPdfSparsePageDictionary | One active page object with ObjectNumber, Generation, and bounded Dictionary bytes |
TPdfSparsePageDictionaries | Dynamic array of active page dictionaries in page-tree order |
TPdfSparseDictionaryReader | Reusable owner of a sparse classic, xref-stream, hybrid, and object-stream index for repeated exact-generation dictionary lookup without source-sized allocation |
TPdfPruneReport | Reachability result with SourceByteCount, OutputByteCount, KeptObjectCount, PrunedObjectCount, Succeeded, and ErrorMessage |
TPdfResourcePruneReport | Resource-pruning result with ScannedScopeCount, UpdatedScopeCount, RemovedNameCount, RemovedObjectCount, stream counts, byte totals, success state, and error text |
TPdfDedupReport | Deduplication result with SourceByteCount, OutputByteCount, KeptObjectCount, PrunedObjectCount, MergedFontCount, MergedImageCount, MergedFormXObjectCount, Succeeded, and ErrorMessage |
TPdfFlateRecompressOptions | Replacement thresholds MinSavingBytes and MinSavingRatio |
TPdfFlateRecompressReport | Recompression result with SourceByteCount, OutputByteCount, RecompressedCount, SkippedCount, FailedCount, OriginalStreamBytes, RecompressedStreamBytes, Succeeded, and ErrorMessage |
TPdfInlineImageExternaliseOptions | Contains SkipUnsafePages, which preserves pages whose inline-image boundaries cannot be resolved |
TPdfInlineImageExternaliseReport | Externalisation result with SourceByteCount, OutputByteCount, ExternalisedCount, SkippedPageCount, FailedCount, CreatedXObjectCount, Succeeded, and ErrorMessage |
TPdfReproducibleReport | Deterministic rewrite result with SourceByteCount, OutputByteCount, KeptObjectCount, PrunedObjectCount, StrippedTimestampCount, Succeeded, and ErrorMessage |
TPdfPageLabelStyle | Numbering styles plsNone, plsDecimal, plsUppercaseRoman, plsLowercaseRoman, plsUppercaseLetters, and plsLowercaseLetters |
TPdfPageLabelRange | One label range with zero-based StartPageIndex, Style, Prefix, and StartNumber |
TPdfPageLabelRanges | Dynamic array of TPdfPageLabelRange values |
TPdfPageLabelReport | Label rewrite result with SourceByteCount, OutputByteCount, AppliedRangeCount, ReplacedExistingLabels, Succeeded, and ErrorMessage |
TPdfOptionalContentUsage | Visibility contexts ocuView, ocuPrint, ocuExport, and ocuDesign |
TPdfOptionalContentState | Per-usage states ocsUnspecified, ocsOn, and ocsOff |
TPdfOptionalContentBaseState | Configuration base states ocbsOn, ocbsOff, and ocbsUnchanged |
TPdfOptionalContentMembershipPolicy | Membership policies ocmpAnyOn, ocmpAllOn, ocmpAnyOff, ocmpAllOff, and ocmpUnknown |
TPdfOptionalContentIntegerArray | Dynamic integer array used for optional-content object-number collections |
TPdfOptionalContentStringArray | Dynamic AnsiString array used for PDF name collections |
TPdfOptionalContentWideStringArray | Dynamic WideString array used for decoded optional-content text |
TPdfOptionalContentRadioGroup | One mutually exclusive group represented by GroupObjectNumbers |
TPdfOptionalContentRadioGroups | Dynamic array of TPdfOptionalContentRadioGroup values |
TPdfOptionalContentGroup | OCG record with ObjectNumber, Generation, Name, Intents, ViewState, PrintState, ExportState, PageElementSubtype, Language, LanguagePreferred, UserType, UserNames, HasZoomRange, MinimumZoom, MaximumZoom, EffectiveVisible, Locked, and RadioGroupIndex |
TPdfOptionalContentGroups | Dynamic array of TPdfOptionalContentGroup values |
TPdfOptionalContentConfiguration | Configuration record with ObjectNumber, Generation, Name, Creator, BaseState, Intents, OnGroupObjectNumbers, OffGroupObjectNumbers, LockedGroupObjectNumbers, OrderGroupObjectNumbers, RadioGroups, and HasAutomaticState |
TPdfOptionalContentConfigurations | Dynamic array of TPdfOptionalContentConfiguration values |
TPdfOptionalContentMembership | OCMD record with ObjectNumber, Generation, GroupObjectNumbers, Policy, VisibilityExpression, and EffectiveVisible |
TPdfOptionalContentMemberships | Dynamic array of TPdfOptionalContentMembership values |
TPdfOptionalContentInventory | Inspection result with Usage, SelectedConfigurationIndex, Groups, Configurations, Memberships, Succeeded, and ErrorMessage |
TPdfOptionalContentStateChange | Requested Visible state for one GroupObjectNumber |
TPdfOptionalContentStateChanges | Dynamic array of TPdfOptionalContentStateChange values |
TPdfOptionalContentConfigureOptions | Selected configuration and usage plus DisableAutomaticState and EnforceRadioGroups controls |
TPdfOptionalContentConfigureReport | Configuration result with SourceByteCount, OutputByteCount, GroupCount, ChangedGroupCount, UpdatedUsageStateCount, SelectedConfigurationIndex, RemovedAutomaticState, Succeeded, and ErrorMessage |
TPdfSanitiseOptions | Independent StripOpenAction, StripCatalogActions, StripNames, StripAssociatedFiles, StripAcroForm, StripMetadata, and RemoveUnreachable controls |
TPdfSanitiseReport | Sanitisation result with SourceByteCount, OutputByteCount, StrippedEntryCount, PrunedObjectCount, nested PruneReport, Succeeded, and ErrorMessage |
TPdfObjectGraphInspectOptions | Bounds the JSON export with MaxObjects, MaxDepth, MaxOutputBytes, MaxStringBytes, and IncludeStreamDigests |
TPdfObjectGraphReport | Shared export and patch result with SourceByteCount, OutputByteCount, ObjectCount, ExportedObjectCount, PatchedObjectCount, AppliedOperationCount, Truncated, Succeeded, and ErrorMessage |
TPdfObjectPatchOperationKind | Patch actions popSet and popRemove |
TPdfObjectPatchValueKind | Value kinds povNull, povBoolean, povInteger, povReal, povName, povTextString, and povReference |
TPdfObjectPatchValue | Tagged value with Kind, BooleanValue, IntegerValue, RealValue, TextValue, ReferenceObjectNumber, and ReferenceGeneration |
TPdfObjectPatchOperation | One operation with Kind, ObjectNumber, Generation, Key, and Value |
TPdfObjectPatchOperations | Dynamic array of TPdfObjectPatchOperation values |
TPdfTreeEditor, TPdfOutlineEditor, and GraftPdfAcroForm reject encrypted input because their standalone serializers do not inherit document security parameters, and all source and destination streams must remain seekable during verified saveGraftPdfAcroForm rejects XFA, dangling references, unmapped widget pages, duplicate page mappings, and default-resource collisions; signed destinations require explicit authorizationTPdf methods expose explicit authorization where signed input can be acceptedPatchPdfObjectGraph refuses duplicate operations, missing objects, malformed or duplicate dictionary keys, protected stream filter and length keys, and missing reference targetsAppendPdfDirtyRevision requires matching baseline and previous-output catalog references and cannot encode an indirect object that was freedSanitiseActiveContentPdfStream workspace overload requires three distinct seekable streams when RemoveUnreachable=TrueTPdfOutlineEditor.SetUri replaces a destination with a UTF-8 URI action and safely encodes literal delimiters; save verification ignores expanded state on leaf items because PDF omits their branch Count
The GraftPdfAcroForm options overload supports pagcpReject, pagcpRename, pagcpNamespace and compatible terminal text/choice joining with selected-widget pruning, isolated resources, appearances and calculation order; see FPdfFormMerge for policies and transactional document integration
TPdfAcroFormGraftOptions.NamespacePrefix names the parent inserted by the namespace policy; TPdfAcroFormCollisionPolicy.pagcpMergeCompatible joins supported compatible terminal text or choice fields
TPdfAcroFormGraftReport.FilteredFieldCount and TPdfAcroFormGraftReport.FilteredWidgetCount count source entries removed by selected-page filtering; TPdfAcroFormGraftReport.ResourceRenameCount counts isolated default resource names and TPdfAcroFormGraftReport.MergedFieldCount counts compatible fields joined to an existing owner
CapturePdfNavigation and WritePdfNavigation capture and remap named destinations and page-link annotations using explicit owner-page mappings; see FPdfMerge for raw key semantics, destination parameters, limits and transactional integration
TPdfNavigationNamedDestination= record
// Keep the original PDF string bytes, including a UTF-16 BOM when present
NameKey: AnsiString;
// Absolute one-based page number; zero denotes an unresolved target
PageNumber: Integer;
// Exact destination mode and parameters, including null values
DestinationSuffix: AnsiString;
end;
TPdfNavigationNamedDestinations= array of TPdfNavigationNamedDestination;
TPdfNavigationPageLink= record
// Owner page is one-based; annotation and link-only ordinals are zero-based
PageNumber, AnnotationIndex, LinkIndex: Integer;
HasDestination, HasGotoAction: Boolean;
DestinationPageNumber, ActionPageNumber: Integer;
DestinationSuffix, ActionSuffix: AnsiString;
end;
TPdfNavigationPageLinks= array of TPdfNavigationPageLink;
ReadPdfActiveObjects returns the latest active object values with their exact generation numbers and the active catalog revision, resolving classic xref tables, xref streams, incremental revisions and compressed object-stream members
Body excludes the indirect-object header and endobj marker; ordinary streams retain their dictionary and encoded payload, while compressed members are materialized as ordinary values, and xref/object-stream infrastructure is excluded from the returned collection
The source position is restored and a failure returns an empty object collection with diagnostics; encrypted input is rejected, while signatures can be inspected without altering their bytes
Defaults allow 256 MiB of source bytes, 64 MiB per materialized body, 256 MiB of cumulative bodies, 64 MiB per decoded object stream, 256 MiB of cumulative decoded object-stream caches and 1,000,000 object-number slots
Body limits are checked before each body copy and count temporary infrastructure bodies as well as returned values; the independently named decoded-cache limits stop object-stream decoding before exceeding the caller's budget
These are logical buffer limits, not a process-wide memory cap: source copies, the direct-object staging stream, scan buffers, decoder working storage and object metadata consume additional bounded allocations, and scan buffers can duplicate retained bodies
type
TPdfActiveObject = record
ObjectNumber, Generation: Integer;
Body: TBytes;
end;
TPdfActiveObjects = array of TPdfActiveObject;
TPdfActiveObjectReadOptions = record
MaxSourceBytes, MaxObjectBytes, MaxTotalObjectBytes: Int64;
MaxDecodedObjectStreamBytes, MaxTotalDecodedObjectStreamBytes: Int64;
MaxObjects: Integer;
class function Default: TPdfActiveObjectReadOptions; static;
end;
function ReadPdfActiveObjects(Source: TStream;
const Options: TPdfActiveObjectReadOptions; out Objects: TPdfActiveObjects;
out Revision: TPdfSparseRevisionInfo; out ErrorText: string): Boolean;