Debenu Quick PDF logo

DACapturePageEx

Direct access functionality, Page manipulation

Description

Captures the specified page from a document originally opened with DAOpenFile. The captured page is hidden, but can then be drawn onto any other page using the DADrawCapturedPage function. The "media box" for the page is used as the bounding rectangle for the capture page. The DACapturePageEx function can be used in cases where the "crop box" for the page should be used instead.

If a document has an open action set to the captured page the resulting file will not load correctly in Acrobat and other PDF viewers. The RemoveOpenAction function can be used to remove the open action but this cannot be done using the Direct Access functions.

Syntax

Delphi

function TDebenuPDFLibrary1511.DACapturePageEx(FileHandle, PageRef, 
  Options: Integer): Integer;

ActiveX

Function DebenuPDFLibrary1511.PDFLibrary::DACapturePageEx(FileHandle As Long,
  PageRef As Long, Options As Long) As Long

DLL

int DPLDACapturePageEx(int InstanceID, int FileHandle, int PageRef, int Options)

Parameters

FileHandle A handle returned by the DAOpenFile, DAOpenFileReadOnly or DAOpenFromStream functions
PageRef A page reference returned by the DAFindPage or DANewPage functions
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 FileHandle or PageRef were not valid, or the specified page was the only page in the document
Non-zero An ID that can be used with the DADrawCapturedPage function

Copyright © 2014 Debenu. All rights reserved. AboutContactBlogNewsletterSupport