THPDFHeadlessDocument.AppendImportedPages
function AppendImportedPages(Source: THPDFHeadlessDocument;
const PageIndices: array of Integer;
const ImportOptions: THPDFHeadlessPageImportOptions): THPDFHeadlessPageImportResult;按给定顺序追加去重后的零起算源页面索引;空选择返回全零计数,重复选择抛出 hdInvalidDocument,Source 保持原有所有权和内容
该 API 可跨原生 Linux FPC 与 Windows FPC/Delphi 移植,包括 AES R5/R6 的源和目标文档
原生缺失外观恢复
要获得更广的受支持静态恢复,请启用 Options.SynthesizeMissingAppearances,而不是要求每个可见源注释都已带 normal 外观;原生矢量合成 profile 记录了资源所有权、生成与移除计数、累计工作量上限与 JSON 绑定
该选项默认 false;两个合成选项同时启用时,显式启用的所供字体 FreeText 路径保留优先权
显式的缺失 FreeText 补建
Options := THPDFHeadlessPageImportOptions.Default;
Options.SynthesizeMissingFreeText := True;
Options.MissingFreeTextFontResource := 'F0';
Options.MissingFreeTextFont := FontBytes;
ImportResult := Destination.AppendImportedPages(Source, [0], Options);
Destination.SaveToFile(OutputFileName);
有限的 FreeText 配置会在与导入页面相同的分阶段事务中创建自有的 Form、内嵌字体与 ToUnicode 对象;源注解和源字节不被更改
成功返回后,调用方可以在保存目标文档之前释放 Source 并清空或释放其字体缓冲区;生成的资源不依赖两者的生命周期
请把 ImportResult.SynthesizedFreeTextAnnotations 与总摊平数分开查看;既有的普通 appearance 仍走原导入路径
pages.import JSON 绑定通过 synthesizeMissingFreeText、missingFreeTextFontResource 和 missingFreeTextFontBase64 暴露同一有限补建配置;结果报告 synthesizedFreeTextAnnotations,既有 Linux C ABI 记录与头文件保持不变