THPDFHeadlessDocument.AppendImportedPages

function AppendImportedPages(Source: THPDFHeadlessDocument;
  const PageIndices: array of Integer;
  const ImportOptions: THPDFHeadlessPageImportOptions): THPDFHeadlessPageImportResult;

Append distinct zero-based source page indices in the supplied order; an empty selection returns zero counts, duplicate selection raises hdInvalidDocument, and Source retains its original ownership and contents

The API is portable across native Linux FPC and Windows FPC/Delphi, including AES R5/R6 source and destination documents

Native missing-appearance recovery

For broader supported static recovery, enable Options.SynthesizeMissingAppearances instead of requiring each visible source annotation to have an existing normal appearance; the native vector synthesis profile documents resource ownership, generated and removed counters, cumulative work limits and the JSON binding

The option defaults to false, and an explicitly enabled supplied-font FreeText path keeps precedence when both synthesis options are enabled

Explicit missing-FreeText synthesis

Options := THPDFHeadlessPageImportOptions.Default;
Options.SynthesizeMissingFreeText := True;
Options.MissingFreeTextFontResource := 'F0';
Options.MissingFreeTextFont := FontBytes;
ImportResult := Destination.AppendImportedPages(Source, [0], Options);
Destination.SaveToFile(OutputFileName);

The finite FreeText profile creates owned Form, embedded-font and ToUnicode objects in the same staged transaction as the imported page; source annotations and source bytes are not changed

After a successful return, the caller may release Source and clear or release its font buffer before saving the destination; generated resources do not depend on either lifetime

Inspect ImportResult.SynthesizedFreeTextAnnotations separately from the total flattened count; existing normal appearances retain the original import path

The pages.import JSON binding exposes the same finite synthesis profile through synthesizeMissingFreeText, missingFreeTextFontResource and missingFreeTextFontBase64; the result reports synthesizedFreeTextAnnotations, while the existing Linux C ABI records and header remain unchanged

Page import and preserved archival contracts · Native document workflows