Page object

The Page object defines methods to retrieve information from a page or modify it.

Page properties

Name

Type

Description

Orientation

Integer

Gets/sets the orientation of the page, in degrees. The value is always a multiple of 90 and is the number of degrees the page should be rotated clockwise when displayed or printed.

Page methods

Name

Return type

Description

ExtractText2(left, top, right, bottom)

String

Returns the text located inside the region bounded by the left, top, right and bottom parameters. If multiple lines are found, they are separated by a CR-LF pair.

MediaSize()

PdfRect

Returns the size of the actual media, i.e. the sheet of paper.

setIncludeBorders(pbIncludeBorders)

 

Sets whether or not borders are included for Page.ExtractText2(). If true, a character is considered to be inside the region using the 30% rule (i.e. at least 30% of the character must be enclosed in the region). Otherwise, the character must be entirely enclosed in the region to be returned.

Merge(imageFile, left, top, rotateAngle, scaleFactor)

 

Inserts an image file and places it on the page at a specific location.
Supported image types are: JPG and PNG.

Merge2(srcPage, left, top, rotateAngle, scaleFactor)

 

Transparently places a PDF page on top of the current page at a specific location.

MergeToLayer(imageFile, left, top, rotateAngle, scaleFactor, layerName)

 

This method behaves the same as Merge() but allows to insert the image as a layer (aka an Optional Content Group).
Supported image types are JPG and PNG.

MergeToLayer2(srcPage, left, top, rotateAngle, scaleFactor, layerName)

 

This method behaves the same as Merge2() but allows to put the source page as a layer (aka an Optional Content Group).

Size()

PdfRect

Returns the size of the rectangle that is used to clip (crop) the content of the page before applying it to the medium, in points.