PDFium Delphi Component Docs

트랜잭션 AcroForm 병합

FPdfFormMerge를 추가하면 MergePdfFilesWithForms 또는 TPdfFormMergeHelper.MergeFilesWithForms를 사용할 수 있습니다

헬퍼는 선택 페이지 가져오기와 필드 이식을 준비하고 소유자를 잃은 가져온 위젯을 제거합니다. 저장 결과를 독립적으로 다시 열어 확인한 뒤 호출자의 문서를 교체하며 오류나 취소 시 대상은 그대로 둡니다

pagcpReject는 완전한 필드 이름의 중복을 거부하고 pagcpRename은 결정적으로 충돌 없는 접두사와 접미사를 붙입니다. pagcpNamespace는 실제 부모 필드를 추가해 소스별로 분리합니다

pagcpMergeCompatible는 호환되는 말단 텍스트/선택 필드를 합쳐 위젯이 하나의 값을 공유하게 합니다. flags, 값, 기본값, 선택 항목, 독립적인 폰트 의미가 같아야 하며 필드 action, rich text, 호환되지 않는 필드 유형은 거부합니다

선택 페이지 필터는 쓰지 않는 위젯과 필드를 제거하고 필터링 및 중복 제거 후의 계산 순서를 유지합니다. 기본 리소스를 분리하고 기본 외관 이름을 바꾸며 복제한 외관 스트림은 자체 리소스를 유지합니다

필드와 위젯이 결합된 사전은 호환 필드를 합치기 전에 정규화합니다. 독립된 이름은 저장하고 다시 열어도 개별 편집이 가능합니다

InsertAt은 0부터 시작하는 삽입 위치이며 -1은 끝에 추가합니다. 기본 상한은 총 10,000페이지, 문서마다 256 MiB, 이식 100,000객체와 깊이 128입니다

이식의 하드 상한은 1,000,000객체, 깊이 256, 루트 필드 4,096개입니다. 선택 페이지 반복, 소스나 대상의 XFA 및 서명, 암호화된 대상은 거부합니다

소스 암호로 준비 중인 병합용 입력을 복호화할 수 있습니다. 결과는 암호화되지 않으므로 필요하면 이후에 명시적인 암호화 작업을 적용하세요

기존 GraftPdfAcroForm 오버로드는 거부 정책을 유지합니다. TPdfAcroFormGraftOptions를 받는 오버로드는 같은 충돌 및 리소스 정책을 스트림 수준에서 제공합니다

이 폼 헬퍼는 소스 outline이나 명명된 목적지를 유지하지 않습니다. 선언된 탐색 작업에는 탐색 헬퍼를 사용하세요

Options := TPdfFormMergeOptions.Default;
Options.GraftOptions.CollisionPolicy := pagcpNamespace;
if not MergePdfFilesWithForms(Pdf, Sources, Options, Report) then
  raise EPdfError.Create(Report.ErrorMessage);

공개 선언

type
  TPdfFormMergeOptions= record
    GraftOptions: TPdfAcroFormGraftOptions;
    InsertAt: Integer;
    MaxPages: Integer;
    MaxDocumentBytes: Int64;
    CancellationToken: IPdfCancellationToken;
    class function Default: TPdfFormMergeOptions; static;
  end;
  TPdfFormMergeReport= record
    Succeeded, Cancelled: Boolean;
    ImportedSourceCount, ImportedPageCount: Integer;
    GraftedFieldCount, RenamedFieldCount, MergedFieldCount: Integer;
    FilteredFieldCount, FilteredWidgetCount, ResourceRenameCount: Integer;
    ErrorMessage: string;
  end;

function MergePdfFilesWithForms(Destination: TPdf;
  const Sources: TPdfBatchMergeSources; const Options: TPdfFormMergeOptions;
  out Report: TPdfFormMergeReport): Boolean;

type
  TPdfFormMergeHelper= class helper for TPdf
    function MergeFilesWithForms(const Sources: TPdfBatchMergeSources;
      const Options: TPdfFormMergeOptions;
      out Report: TPdfFormMergeReport): Boolean;
  end;