ImageEn, unit iexUserInteractions

TIEPdfViewer.AddPage

TIEPdfViewer.AddPage


Declaration

// Blank page overloads
function AddPage(PaperWidth: Double = -1; PaperHeight: Double = -1; InsertIndex: Integer = -1): integer; overload;
function AddPage(Size: TIOPDFPaperSize; Layout: TIEPageLayout = ielPortrait; InsertIndex: Integer = -1): integer; overload;

// Image overloads
function AddPage(Bitmap: TIEBitmap; PaperWidth: Double = -1; PaperHeight: Double = -1; InsertIndex: Integer = -1;
                 PageMargin: Integer = 0; CenterImage: Boolean = True; AllowStretching: Boolean = False): integer; overload;
function AddPage(Bitmap: TIEBitmap; Size: TIOPDFPaperSize; Layout: TIEPageLayout = ielPortrait; InsertIndex: Integer = -1;
                 PageMargin: Integer = 0; CenterImage: Boolean = True; AllowStretching: Boolean = False): integer; overload;

// Layer overloads
function AddPage(LayersList: TList; PaperWidth: Double = -1; PaperHeight: Double = -1; InsertIndex: Integer = -1;
                 PageVertMargin: Integer = 0; PageHorzMargin: Integer = 0): integer; overload;
function AddPage(LayersList: TList; Size: TIOPDFPaperSize; Layout: TIEPageLayout = ielPortrait; InsertIndex: Integer = -1;
                 PageVertMargin: Integer = 0; PageHorzMargin: Integer = 0): integer; overload;


Description

Adss a page from to the document.
You can specify the page size in terms of Adobe PDF points (1 point = 1/72 of inch), pass -1 to use the current page size, or a standard size such as A4.
InsertIndex specifies the insertion position, e.g. specifying 1 will make it the second page (becomes index 1). If -1 is specified, the pages are added at the end of the document.
You can optionally add content to the new page, either a TIEBitmap or the layers of a TImageEnView (by passing TImageEnView.LayersList to the method).

Result will the index of the added page.

Note: DocModified will be true after adding


Demo

Demo  Demos\Other\PdfPageObjects\PdfPageObjects.dpr


Examples

// Append a blank A4 page
ImageEnView1.PdfViewer.AddPage( iepA4 );

// Insert a blank page of the current size to the current position
ImageEnView1.PdfViewer.AddPage( -1, -1, ImageEnView1.PdfViewer.PageIndex );

// Append an image page with 1 inch margins and stretched to fit
ImageEnView1.PdfViewer.AddPage( ImageEnView2.IEBitmap, -1, -1, -1, 1, 1, True, True, True );

// Append a layers page
ImageEnView1.PdfViewer.AddPage( ImageEnView2.LayersList );


See Also

 DeletePages
 ImportPages