Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TdxPDFPages.Add(TdxPDFDocument,Integer) Method

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

#Declaration

Delphi
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