#include <Page.h>
Public Types | |
enum | Box { e_media, e_crop, e_bleed, e_trim, e_art, e_user_crop } |
enum | Rotate { e_0, e_90, e_180, e_270 } |
enum | ActionTriggerEvent { e_action_trigger_page_open = 11, e_action_trigger_page_close = 12 } |
Static Public Member Functions | |
static Rotate | AddRotations (Rotate r0, Rotate r1) |
static Rotate | SubtractRotations (Rotate r0, Rotate r1) |
static int | RotationToDegree (Rotate r) |
static Rotate | DegreeToRotation (int r) |
Page is a high-level class representing PDF page object (see 'Page Objects' in Section 3.6.2, 'Page Tree,' in PDF Reference Manual).
Among other associated objects, a page object contains:
PDF page can define as many as five separate boundaries to control various aspects of the imaging process (for more details please refer to Section 10.10.1 'Page Boundaries' in PDF Reference Manual):
Enumerator | |
---|---|
e_media | |
e_crop | |
e_bleed | |
e_trim | |
e_art | |
e_user_crop |
pdftron::PDF::Page::Page | ( | SDF::Obj | page_dict = 0 | ) |
Initialize a page using an existing low-level Cos/SDF page object.
page_dict | - a low-level (SDF/Cos) page dictionary. |
pdftron::PDF::Page::Page | ( | const Page & | p | ) |
Rotate r0 clockwise by r1
r0 | first rotation. |
r1 | second rotation. |
Adds an annotation at the specified location in a page's annotation array.
pos | - The location in the array to insert the object. The object is inserted before the specified location. The first element in an array has a pos of zero. If pos >= GetNumAnnots(), the method appends the annotation to the array. |
annot | - The annotation to add. |
void pdftron::PDF::Page::AnnotPushBack | ( | Annot & | annot | ) |
Adds an annotation to the end of a page's annotation array.
annot | - The annotation to prepend in a page's annotation array. |
void pdftron::PDF::Page::AnnotPushFront | ( | Annot & | annot | ) |
Adds an annotation to the beginning of a page's annotation array.
annot | - The annotation to append in a page's annotation array. |
void pdftron::PDF::Page::AnnotRemove | ( | Annot & | annot | ) |
Removes the given annotation from the page.
annot | The annotation to remove. |
void pdftron::PDF::Page::AnnotRemove | ( | UInt32 | index | ) |
Removes the annotation at a given location.
index | - A zero based index of the annotation to remove. |
|
static |
Convert a number that represents rotation in degrees to a rotation enum.
r | degree to convert to rotation. Valid numbers are multiples of 90. |
SDF::Obj pdftron::PDF::Page::FindInheritedAttribute | ( | const char * | attrib | ) | const |
Some of the page attributes are designated as inheritable. If such an attribute is omitted from a page object, its value is inherited from an ancestor node in the page tree. If the attribute is a required one, a value must be supplied in an ancestor node; if it is optional and no inherited value is specified, the default value should be used.
The function walks up the page inheritance tree in search for specified attribute.
attrib | A string representing the attribute to search for. |
Resources dictionary (Required; inheritable) MediaBox rectangle (Required; inheritable) CropBox rectangle (Optional; inheritable) Rotate integer (Optional; inheritable)
void pdftron::PDF::Page::FlattenField | ( | class Field | field_to_flatten | ) |
Flatten/Merge existing form field appearances with the page content and remove widget annotation.
Form 'flattening' refers to the operation that changes active form fields into a static area that is part of the PDF document, just like the other text and images in the document. A completely flattened PDF form does not have any widget annotations or interactive fields.
field_to_flatten | field to flatten |
Returns the annotation on the page.
index | - The index of the annotation to get on a page. The first annotation on a page has an index of zero. |
SDF::Obj pdftron::PDF::Page::GetAnnots | ( | ) | const |
Returns SDF/Cos array containing annotation dictionaries. See Section 8.4 in the PDF Reference for a description of the annotation array.
type | The type of the page bounding box. Possible values are: e_media, e_crop, e_bleed, e_trim, and e_art. |
If the value for 'type' is e_crop, this call is equivalent to GetCropBox(). If the value for 'type' is e_media, this call is equivalent to GetMediaBox().
SDF::Obj pdftron::PDF::Page::GetContents | ( | ) | const |
Rect pdftron::PDF::Page::GetCropBox | ( | ) | const |
The crop box is the region of the page to display and print.
Common::Matrix2D pdftron::PDF::Page::GetDefaultMatrix | ( | bool | flip_y = false , |
Box | box_type = e_crop , |
||
Rotate | angle = e_0 |
||
) | const |
flip_y | this parameter can be used to mirror the page. if 'flip_y' is true the Y axis is not flipped and it is increasing, otherwise Y axis is decreasing. |
box_type | an optional parameter used to specify the page box/region that the matrix should map to. By default, the function transforms user space coordinates to cropped coordinates. |
angle | an optional parameter used to specify page rotation in addition to the rotation specified in the page dictionary. This parameter is usually used to rotate the page without modifying the document itself. |
int pdftron::PDF::Page::GetIndex | ( | ) | const |
Rect pdftron::PDF::Page::GetMediaBox | ( | ) | const |
The media box defines the boundaries of the physical medium on which the page is to be printed. It may include any extended area surrounding the finished page for bleed, printing marks, or other such purposes.
if | the page is missing media box the function throws Exception |
UInt32 pdftron::PDF::Page::GetNumAnnots | ( | ) | const |
Returns the number of annotations on a page. Widget annotations (form fields) are included in the count.
box_type | indicates the page box/region to query for height. |
box_type | indicates the page box/region to query for width. |
SDF::Obj pdftron::PDF::Page::GetResourceDict | ( | ) | const |
if | the page is missing resource dictionary the function throws Exception |
Rotate pdftron::PDF::Page::GetRotation | ( | ) | const |
SDF::Obj pdftron::PDF::Page::GetSDFObj | ( | ) | const |
Returns the page dictionary.
SDF::Obj pdftron::PDF::Page::GetTriggerAction | ( | Page::ActionTriggerEvent | trigger | ) |
double pdftron::PDF::Page::GetUserUnitSize | ( | ) | const |
Returns the UserUnit value for the page. A UserUnit is a positive number giving the size of default user space units, in multiples of 1/72 inch.
Rect pdftron::PDF::Page::GetVisibleContentBox | ( | ) | const |
The bounding box is defined as the smallest rectangle that includes all the visible content on the page.
bool pdftron::PDF::Page::HasTransition | ( | ) | const |
Tests whether this page has a transition.
bool pdftron::PDF::Page::IsValid | ( | ) | const |
|
inline |
|
static |
Convert a rotation to a number.
r | rotation to convert to number |
void pdftron::PDF::Page::Scale | ( | double | scale | ) |
A utility method used to scale physical dimensions of the page including all page content.
scale | A number greater than 0 which is used as a scale factor. For example, calling page.Scale(0.5) will reduce physical dimensions of the page to half its original size, whereas page.Scale(2) will double the physical dimensions of the page and will rescale all page content appropriately. |
Sets the page bounding box specified by 'page_region' for this page.
type | The type of the page bounding box. Possible values are: e_media, e_crop, e_bleed, e_trim, and e_art. |
box | A rectangle specifying the coordinates to set for the box. The coordinates are specified in user space units. |
void pdftron::PDF::Page::SetCropBox | ( | const Rect & | box | ) |
Sets the crop box for this page. The crop box is the region of the page to display and print.
box | the new crop box for this page. The page dimensions are specified in user space coordinates. |
The crop box defines the region to which the contents of the page are to be clipped (cropped) when displayed or printed.
void pdftron::PDF::Page::SetMediaBox | ( | const Rect & | box | ) |
Sets the media box for this page.
box | the new media box for this page. The page dimensions are specified in user space coordinates. |
The media box defines the boundaries of the physical medium on which the page is to be printed. It may include any extended area surrounding the finished page for bleed, printing marks, or other such purposes.
void pdftron::PDF::Page::SetRotation | ( | Rotate | angle | ) |
Sets the rotation value for this page.
angle | Rotation value to be set for a given page. Must be one of the Page::Rotate values. |
void pdftron::PDF::Page::SetUserUnitSize | ( | double | unit_size | ) |
Rotate r0 counter clockwise by r1.
r0 | first rotation. |
r1 | second rotation. |