Skip to main content

TdxPDFPages.Add(TdxPDFDocument,Integer) Method

Appends a specified page from a source PDF document to the current document.

Declaration

procedure Add(ASource: TdxPDFDocument; ASourceIndex: Integer); overload;

Parameters

Name Type Description
ASource TdxPDFDocument

A source PDF document container.

ASourceIndex Integer

A page index in the source document.

Remarks

The following code example appends the second and third pages from a source document to the current document:

var
  ADocument: TdxPDFDocument;
  ASource: TdxPDFDocument;
begin
  ADocument := TdxPDFDocument.Create;
  try
    ADocument.LoadFromFile('Data\Demo.pdf');
    ASource.LoadFromFile('Data\Source.pdf');

    ADocument.BeginUpdate;
    try
      ADocument.Pages.Add(ASource, 1);
      ADocument.Pages.Add(ASource, 2);
    finally
      ADocument.EndUpdate;
    end;
    ADocument.SaveToFile('Data\Result.pdf');
  finally
    ADocument.Free;
    ASource.Free;
  end;
See Also