CapturePageEx
Page manipulation
Description
This function "captures" a page. Once the page has been captured it can be drawn onto other pages. This is useful for combining different pages or for placing more than one original page onto another page (imposition). Once a page has been captured it is removed from the document. If you would like the page to remain in the document you must create a blank page and draw the captured page onto the blank page
Also, because a document must have at least one page at all times it is not possible to capture a page if it is the only page in the document. In this case, you must add a new blank page before the existing page can be captured
CapturePageEx removes the captured page from its current document; use ImportPageAsFormXObject to preserve the source page or import it from another open document
The "media box" for the page is used as the bounding rectangle for the captured page. The CapturePageEx function can be used in cases where the "crop box" for the page should be used instead
MediaBox and CropBox may be inherited from a parent page-tree node. BleedBox, TrimBox and ArtBox belong to the page itself and are never inherited; when absent, their effective dimensions default to the effective CropBox
Syntax
Delphi
Function TPDFlib.CapturePageEx(Page, Options: Integer): Integer;
ActiveX
Function PDFlib::CapturePageEx(Page As Long, Options As Long) As Long
DLL
int DLCapturePageEx(int InstanceID, int Page, int Options);
Parameters
| Page | The page number to capture. The first page in the document is page 1 |
|---|---|
| Options | 0 = Use the page's media box for the bounding rectangle 1 = Use the page's crop box for the bounding rectangle if it has one, otherwise use the media box 2 = Use the page's bleed box for the bounding rectangle if it has one, otherwise use the crop box 3 = Use the page's trim box for the bounding rectangle if it has one, otherwise use the crop box 4 = Use the page's art box for the bounding rectangle if it has one, otherwise use the crop box |
Return values
| 0 | The specified page does not exist, or it is the only page in the document |
|---|---|
| Non-zero | The ID of the capture process. This ID must be supplied to the DrawCapturedPage function |