foxit.pdf.PDFPage Class Reference
Inheritance diagram for foxit.pdf.PDFPage:
foxit.pdf.GraphicsObjects foxit.common.Base

Public Types

enum  BoxType {
  BoxType.e_MediaBox = 0, BoxType.e_CropBox = 1, BoxType.e_TrimBox = 2, BoxType.e_ArtBox = 3,
  BoxType.e_BleedBox = 4
}
 Enumeration for page box type.
More...
 
enum  CalcMarginMode { CalcMarginMode.e_CalcContentsBox = 0, CalcMarginMode.e_CalcDetection = 1 }
 Enumeration for calculating margin mode.
More...
 
enum  FlattenOptions { FlattenOptions.e_FlattenAll = 0, FlattenOptions.e_FlattenNoAnnot = 0x0001, FlattenOptions.e_FlattenNoFormControl = 0x0002 }
 Enumeration for flatten options.
More...
 
enum  ParseFlags { ParseFlags.e_ParsePageNormal = 0x0000, ParseFlags.e_ParsePageTextOnly = 0x0001 }
 Enumeration for parsing flags used for PDF page.
More...
 
enum  Size {
  Size.e_SizeLetter = 1, Size.e_SizeLegal = 2, Size.e_SizeA2 = 3, Size.e_SizeA3 = 4,
  Size.e_SizeA4 = 5, Size.e_SizeA5 = 6, Size.e_SizeA6 = 7, Size.e_SizeB2 = 8,
  Size.e_SizeB3 = 9, Size.e_SizeB4 = 10, Size.e_SizeB5 = 11, Size.e_SizeB6 = 12
}
 Enumeration for page size type.
More...
 

Public Member Functions

 PDFPage (foxit.pdf.PDFDoc document, PDFDictionary page_dict)
 Constructor, from a PDF dictionary which represents a PDF page and the PDF document which contains the dictionary..
More...
 
 PDFPage (GraphicsObjects other)
 Constructor, with parent class object.

 
Annot AddAnnot (Annot.Type type, RectF rect)
 Add an annotation to PDF page.
More...
 
bool AddImage (Image image, int frame_index, PointF position, float width, float height, bool auto_generate_content)
 Add an image to current page.
More...
 
bool AddImageFromFilePath (string file_path, PointF position, float width, float height, bool auto_generate_content)
 Add an image to current page from file path.
More...
 
Signature AddSignature (RectF rect)
 Add a signature to PDF page.
More...
 
RectF CalcContentBBox (PDFPage.CalcMarginMode mode)
 Calculate the content area of PDF page.
More...
 
bool Flatten (bool for_display, int options)
 Flatten current PDF page: annotations or form fields may be made to be a part of the page contents according to specified options.
More...
 
Annot GetAnnot (int index)
 Get an annotation by index.
More...
 
Annot GetAnnotAtDevicePoint (PointF position, float tolerance, Matrix2D matrix)
 Get the annotation at a specified position, in device coordination system.
More...
 
Annot GetAnnotAtPoint (PointF position, float tolerance)
 Get the annotation at a specified position, in PDF coordinate system .
More...
 
int GetAnnotCount ()
 Get the count of annotations.
More...
 
PDFArray GetAnnots ()
 Get the PDF array of "Annots".
More...
 
RectF GetBox (PDFPage.BoxType box_type)
 Get page box.
More...
 
PDFObject GetContents ()
 Get the PDF object of "Contents".
More...
 
PDFDictionary GetDict ()
 Get the page dictionary.
More...
 
Matrix2D GetDisplayMatrix (int left, int top, int width, int height, Rotation rotate)
 Get the display matrix of PDF page, from PDF coordinate system to targeted device coordinate system.
More...
 
PDFDoc GetDocument ()
 Get the PDF document, to which current PDF page belongs.
More...
 
GraphicsObject GetGraphicsObjectAtPoint (PointF point, float tolerance, GraphicsObject.Type filter)
 Get the topmost graphics object in specified point, with specified type filter.
More...
 
GraphicsObjectArray GetGraphicsObjectsAtPoint (PointF point, float tolerance, GraphicsObject.Type filter)
 Get all the graphics objects in specified point, with specified type filter.
More...
 
float GetHeight ()
 Get the page height.
More...
 
int GetIndex ()
 Get page index.
More...
 
PDFObject GetInheritedAttribute (string attruibute_name)
 Get the PDF object for specified attribute which may be inherited from the ancestor node in the page tree.
More...
 
PDFDictionary GetResources ()
 Get the PDF dictionary of "Resources".
More...
 
Rotation GetRotation ()
 Get the page rotation.
More...
 
PDFStream GetThumb ()
 Get the PDF stream of "Thumb".
More...
 
float GetUserUnitSize ()
 Get the user unit.
More...
 
float GetWidth ()
 Get the page width.
More...
 
bool HasTransparency ()
 Check whether current PDF page has transparency or not.
More...
 
bool HasWatermark ()
 Check whether the current page has any watermark (not including Foxit PDF SDK trial watermark).
More...
 
bool IsParsed ()
 Check if current page has been parsed or not.
More...
 
System.Drawing.Bitmap LoadThumbnail ()
 Load the thumbnail bitmap.
More...
 
virtual void MoveAnnotToFirst (Annot annot)
 Change specified annotation to be the first one of all annotations.
More...
 
virtual void MoveAnnotToLast (Annot annot)
 Change specified annotation to be the last one of all annotations.
More...
 
virtual void MoveAnnotToNext (Annot annot)
 Exchange the indexes of current annotation and its next annotation.
More...
 
virtual void MoveAnnotToPrev (Annot annot)
 Exchange the indexes of current annotation and its previous annotation.
More...
 
bool RemoveAllWatermarks ()
 Remove all watermarks.
More...
 
bool RemoveAnnot (Annot annot)
 Remove an annotation.
More...
 
bool SetAnnotGroup (MarkupArray annot_array, int header_index)
 Group all the input markup annotations together.
More...
 
void SetBox (PDFPage.BoxType box_type, RectF box)
 Set page box.
More...
 
void SetClipRect (RectF clip_rect)
 Set clip rectangle for all graphics objects on current PDF page.
More...
 
void SetRotation (Rotation rotate)
 Set page rotation.
More...
 
void SetSize (float width, float height)
 Set page width and height.
More...
 
void SetSize (PDFPage.Size size)
 Set page size type.
More...
 
void SetThumbnail (System.Drawing.Bitmap thumbnail)
 Set page thumbnail.
More...
 
void SetUserUnitSize (float user_unit)
 Set the user unit.
More...
 
Progressive StartParse (int flags, PauseCallback pause, bool is_reparse)
 Start to parse current page.
More...
 
bool Transform (Matrix2D matrix, bool need_transform_clip_path)
 Transform a PDF page, including annotations and form fields on the page.
More...
 
- Public Member Functions inherited from foxit.pdf.GraphicsObjects
 GraphicsObjects (GraphicsObjects other)
 Constructor, with another GraphicsObjects object.

 
bool GenerateContent ()
 Generate contents of current graphics objects.
More...
 
long GetFirstGraphicsObjectPosition (GraphicsObject.Type filter)
 Get the position of first graphics object in graphics object list, based on type filter.
More...
 
GraphicsObject GetGraphicsObject (long position)
 Get the graphics object by position in graphics object list.
More...
 
long GetLastGraphicsObjectPosition (GraphicsObject.Type filter)
 Get the position of last graphics object in graphics object list, based on type filter.
More...
 
long GetNextGraphicsObjectPosition (long position, GraphicsObject.Type filter)
 Get the position of next graphics object in graphics object list, based on type filter and specified current position.
More...
 
long GetPrevGraphicsObjectPosition (long position, GraphicsObject.Type filter)
 Get the position of previous graphics object in graphics object list, based on type filter and specified current position.
More...
 
long InsertGraphicsObject (long position_insert_after, GraphicsObject graphics_object)
 Insert a graphics object after the specified position.
More...
 
bool IsEmpty ()
 Check whether current object is empty or not.
More...
 
bool RemoveGraphicsObject (GraphicsObject graphics_object)
 Remove a graphics object.
More...
 
bool RemoveGraphicsObjectByPosition (long position)
 Remove a graphics object by position.
More...
 

Detailed Description

A PDF page is defined in PDF coordinate system which uses the lower-left corner of the page as origin point (0, 0).
Usually, a pdf::PDFPage object is retrieved from a PDF document by function pdf::PDFDoc::GetPage. For most case, a PDF page should be parsed first and then be used. Function pdf::PDFPage::IsParsed can be used to judge whether the PDF page has been parsed or not. For a unparsed page, please use function pdf::PDFPage::StartParse to parse it.
This class offers functions to get/set data of a PDF page, such as page width/height, page rotation, display matrix and so on. Also, this class offers functions to retrieve PDF annotations:


To get a PDF annotation, use function pdf::PDFPage::GetAnnot, pdf::PDFPage::GetAnnotAtPoint, or pdf::PDFPage::GetAnnotAtDevicePoint.
To add a new PDF annotation, use function pdf::PDFPage::AddAnnot.
To remove a PDF annotation, use function pdf::PDFPage::RemoveAnnot.
Class pdf::PDFPage is derived from class GraphicsObjects, so class pdf::PDFPage also offers functions to retrieve PDF graphics objects:


To get a PDF graphics object, use functions pdf::PDFPage::GetFirstGraphicsObjectPosition, pdf::PDFPage::GetNextGraphicsObjectPosition, pdf::PDFPage::GetLastGraphicsObjectPosition, pdf::PDFPage::GetPrevGraphicsObjectPosition and pdf::PDFPage::GetGraphicsObject (these functions are inherited from class GraphicsObjects), or pdf::PDFPage::GetGraphicsObjectAtPoint.
To insert a PDF graphics object, use function pdf::PDFPage::InsertGraphicsObject (inherited from class GraphicsObjects).
To remove a PDF graphics object, use functions pdf::PDFPage::RemoveGraphicsObjectByPosition or pdf::PDFPage::RemoveGraphicsObject (these functions are inherited from class GraphicsObjects).
This class object can also be used to construct objects of other classes in order to access specified information in PDF page:


To access text content in PDF page, please construct a TextPage with pdf::PDFPage object.
To do reflowing, please construct a ReflowPage with pdf::PDFPage object.
To access additional actions, please construct an actions::AdditionalAction object with pdf::PDFPage object.
To manage the tab order of annotations in PDF page, please construct a TabOrderMgr with pdf::PDFPage object.

See also
pdf::PDFDoc
GraphicsObjects
TextPage
ReflowPage
actions::AdditionalAction
TabOrderMgr

Member Enumeration Documentation

◆ BoxType

Enumeration for page box type.

Values of this enumeration should be used alone.

Enumerator
e_MediaBox 

Media Box for page boundary.

The boundary of the physical medium on which page is to be displayed or printed.

e_CropBox 

Crop Box for page boundary.

The region to which the contents of page are to be clipped (cropped) while displaying or printing.

e_TrimBox 

Trim Box for page boundary.

The region to which the contents of page should be clipped while outputting in a production environment.

e_ArtBox 

Art Box for page boundary.

The intended dimensions of a finished page after trimming.

e_BleedBox 

Bleed Box for page boundary.

The extent of page's meaningful content (including potential white space) as intended by page's creator.

◆ CalcMarginMode

Enumeration for calculating margin mode.

Values of this enumeration should be used alone.

Enumerator
e_CalcContentsBox 

Calculate margin according to bounding box of all contents.

e_CalcDetection 

Calculate margin by detecting paths or images.

◆ FlattenOptions

Enumeration for flatten options.

Values of this enumeration can be used alone or in combination.

Enumerator
e_FlattenAll 

Flatten all contents of a PDF page.

e_FlattenNoAnnot 

Flatten a PDF page without annotations.

e_FlattenNoFormControl 

Flatten a PDF page without form controls.

◆ ParseFlags

Enumeration for parsing flags used for PDF page.

Values of this enumeration can be used alone or in combination.

Enumerator
e_ParsePageNormal 

Parsing flag for normal mode, which means to parse all the contents in a PDF page.

e_ParsePageTextOnly 

Parsing flag for text-only mode.

◆ Size

Enumeration for page size type.

Values of this enumeration should be used alone.

Enumerator
e_SizeLetter 

Page size: letter.

e_SizeLegal 

Page size: legal.

e_SizeA2 

Page size: A2.

e_SizeA3 

Page size: A3.

e_SizeA4 

Page size: A4.

e_SizeA5 

Page size: A5.

e_SizeA6 

Page size: A6.

e_SizeB2 

Page size: B2.

e_SizeB3 

Page size: B3.

e_SizeB4 

Page size: B4.

e_SizeB5 

Page size: B5.

e_SizeB6 

Page size: B6.

Constructor & Destructor Documentation

◆ PDFPage()

foxit.pdf.PDFPage.PDFPage ( foxit.pdf.PDFDoc  document,
PDFDictionary  page_dict 
)
inline

Constructor, from a PDF dictionary which represents a PDF page and the PDF document which contains the dictionary..

Parameters
documentA valid PDF document.
page_dictA PDF dictionary of a PDF page. It should belong to the PDF document specified by parameter document.

Member Function Documentation

◆ AddAnnot()

Annot foxit.pdf.PDFPage.AddAnnot ( Annot.Type  type,
RectF  rect 
)
inline

Add an annotation to PDF page.

Currently, this function can support to add most annotation types except:
Widget, Sound, Movie, PrinterMark, TrapNet, Watermark, 3D, PSInk, Redact.
Attention:


Widget annotation are used to represent the appearance of a form field, including signature field:
For signature field, function pdf::PDFPage::AddSignature can be called to add a new signature object.
For other types of form field, function interform::Form::AddControl can be called to add a new form field (with form control).
PSInk annotation should be converted from a PSI object by function PSI::ConvertToPDFAnnot.
Redact annotation should be added to mark areas in PDF page by function addon::Redaction::MarkRedactAnnot.
For supported annotations types, if user does not set any properties of the newly created annotation (except the required properties) and directly calls function annots::Annot::ResetAppearanceStream, default appearance will be used. Please refer to comment of concrete annotation class for more details of their own default appearance.

Parameters
typeThe type of annotation to be added. Please refer to e_XXX values and it should be one of these values except e_PSInk, e_Sound, e_Movie, e_Widget, {}, e_TrapNet}, e_Watermark}, e_3D}.
rectRectangle of the new annotation.

For annotation in following type, they needs a valid rectangle when being added. So for them, rect should be valid: e_Note, e_Link, e_Square, e_Circle, {}, e_Stamp}, e_Caret}, e_FileAttachment}, { e_Screen}. For rest supported annotation types, their rectangle will be updated when other required properties of them have been set. So for these annotations, rect can be an empty rectangle. If an invalid rectangle is passed to rect, an empty rectangle will be used instead.

Returns
The newly created Annot object.

◆ AddImage()

bool foxit.pdf.PDFPage.AddImage ( Image  image,
int  frame_index,
PointF  position,
float  width,
float  height,
bool  auto_generate_content 
)
inline

Add an image to current page.

If the type of image is e_JPG, the image should be kept valid until the related document is closed.

Parameters
imageAn image. One of its frames will be set to current page. This image contains at least one frame and the image type should not be Image::e_Unknown .
frame_indexFrame index. Valid range: from 0 to (count-1). count is returned by function common::Image::GetFrameCount.
positionA specified position, in PDF coordinate system .
widthThe width which is used for the image to set into page. The value should be larger than 0.
heightThe height which is used for the image to set into page. The value should be larger than 0.
auto_generate_contenttrue means to generate content internally.
When using false, user should ensure to call function GraphicsObjects::GenerateContent after adding image. Please refer to function GraphicsObjects::GenerateContent for more details.
Returns
true means success, while false means failure.

◆ AddImageFromFilePath()

bool foxit.pdf.PDFPage.AddImageFromFilePath ( string  file_path,
PointF  position,
float  width,
float  height,
bool  auto_generate_content 
)
inline

Add an image to current page from file path.

If input image (specified by file path) has more than one frame, only the first frame will be added to current page acquiescently.

Parameters
file_pathA full path of an existing image file. It should not be an empty string.
positionA specified position, in PDF coordinate system .
widthThe width which is used for the image to set into page. The value should be larger than 0.
heightThe height which is used for the image to set into page. The value should be larger than 0.
auto_generate_contenttrue means to generate content internally.
When using false, user should ensure to call function GraphicsObjects::GenerateContent after adding image. Please refer to function GraphicsObjects::GenerateContent for more details.
Returns
true means success, while false means failure.

◆ AddSignature()

Signature foxit.pdf.PDFPage.AddSignature ( RectF  rect)
inline

Add a signature to PDF page.

For a new signature, its filter will be "Adobe.PPKLite" and sub filter will be "adbe.pkcs7.detached" by default. Please refer to class Signature for more details about signature's filter and sub-filter.
Before signing the new signature, user can also call SetXXX() functions of class Signature to set other information used for signing and signed appearance.

Parameters
rectRectangle position for the new signature, in PDF coordinate system . It should be a valid rectangle in PDF coordinate system .
Returns
A Signature object that receives the newly created signature.

◆ CalcContentBBox()

RectF foxit.pdf.PDFPage.CalcContentBBox ( PDFPage.CalcMarginMode  mode)
inline

Calculate the content area of PDF page.

Before using this function, please ensure current page has been parsed.

Parameters
modeCalculation mode. It should be one of following values:

e_CalcContentsBox means to calculate margin according to bounding box of all contents.
e_CalcDetection means to calculate margin by detecting paths or images.

Returns
The minimal rectangle which contains the visible page content.

◆ Flatten()

bool foxit.pdf.PDFPage.Flatten ( bool  for_display,
int  options 
)
inline

Flatten current PDF page: annotations or form fields may be made to be a part of the page contents according to specified options.

Annotation flag can decide if an annotation can be displayed or if an annotation can be printed. This also affects the flattened result:


If the flattened result is used for displaying, only annotations which can be displayed will be flattened to be a part of page contents.
If the flattened result is used for printing, only annotations which can be printed will be flattened to be a part of page contents.
Form field's appearance is represents by widget annotation which is a kind of annotation and treated as form control in Foxit PDF SDK. So annotation flag affects a form field as well when a form field is to be flattened. For more details about annotation flag, please refer to e_FlagXXX values and Section 8.4.2 "Annotation Flags" in <PDF Reference 1.7>.
After an annotation or a form field is flattened, it will not be an annotation or a form field any more. After flattening current page successfully, user should re-parse this page by function pdf::PDFPage::StartParse.

Parameters
for_displayDecide the purpose of the flattened result: true means the flatten result is used for display only, and false means the flatten result is used for print only.
optionsThe flatten options. Please refer to e_FlattenXXX values and it should one or a combination of them.
Specially, if e_FlattenNoAnnot and e_FlattenNoFormControl are used together, that means nothing is to be flatten to page and this function will return true directly. Default value: e_FlattenAll.
Returns
true means current page is flattened successfully, while false means failure.

◆ GetAnnot()

Annot foxit.pdf.PDFPage.GetAnnot ( int  index)
inline

Get an annotation by index.

Parameters
indexAnnotation index. Valid range: from 0 to (count-1). count is returned by function PDFPage::GetAnnotCount.
Returns
An Annot object.

◆ GetAnnotAtDevicePoint()

Annot foxit.pdf.PDFPage.GetAnnotAtDevicePoint ( PointF  position,
float  tolerance,
Matrix2D  matrix 
)
inline

Get the annotation at a specified position, in device coordination system.

If there are several annotations in this specified position, this function will always return the topmost annotation. Annotations with flag e_FlagNoView or e_FlagReadOnly or e_FlagHiddenFlags or e_FlagInvisiblewill not be retrieved by this function.

Parameters
positionThe specified position, in device coordinate system.
toleranceTolerance value. Valid range: 0.0f to 30.0f.
matrixThe transformation matrix. Usually this is returned by function pdf::PDFPage::GetDisplayMatrix. If this is null, current function will have the same feature as function pdf::PDFPage::GetAnnotAtPoint.
Returns
An Annot object. If the return value of function annots::Annot::IsEmpty for the returned Annot object is true, that means no PDF annotation can be found.

◆ GetAnnotAtPoint()

Annot foxit.pdf.PDFPage.GetAnnotAtPoint ( PointF  position,
float  tolerance 
)
inline

Get the annotation at a specified position, in PDF coordinate system .

If there are several annotations in this specified position, this function will always return the topmost annotation. Annotations with flag e_FlagNoView or e_FlagReadOnly or e_FlagHiddenFlags or e_FlagInvisible will not be retrieved by this function.

Parameters
positionThe specified position, in PDF coordinate system .
toleranceTolerance value. Valid range: 0.0f to 30.0f.
Returns
An Annot object. If the return value of function annots::Annot::IsEmpty for the returned Annot object is true, that means no PDF annotation can be found.

◆ GetAnnotCount()

int foxit.pdf.PDFPage.GetAnnotCount ( )
inline

Get the count of annotations.

Returns
The count of annotations.

◆ GetAnnots()

PDFArray foxit.pdf.PDFPage.GetAnnots ( )
inline

Get the PDF array of "Annots".

Note
Please refer to "TABLE 3.27 Entries in a page object" in <PDF Reference 1.7> P147 for more details.
Returns
The PDF array of "Annots".

◆ GetBox()

RectF foxit.pdf.PDFPage.GetBox ( PDFPage.BoxType  box_type)
inline

Get page box.

Parameters
box_typePage box type. Please refer to e_XXXBox values and it should be one of these values.
Returns
A box rectangle, in PDF coordinate system .

◆ GetContents()

PDFObject foxit.pdf.PDFPage.GetContents ( )
inline

Get the PDF object of "Contents".

Note
"Contents" can be either a PDF stream or a PDF array. Please refer to "TABLE 3.27 Entries in a page object" in <PDF Reference 1.7> P146 for more details.
Returns
The PDF object of "Contents".

◆ GetDict()

PDFDictionary foxit.pdf.PDFPage.GetDict ( )
inline

Get the page dictionary.

Returns
The page dictionary object.

◆ GetDisplayMatrix()

Matrix2D foxit.pdf.PDFPage.GetDisplayMatrix ( int  left,
int  top,
int  width,
int  height,
Rotation  rotate 
)
inline

Get the display matrix of PDF page, from PDF coordinate system to targeted device coordinate system.

Parameters
leftLeft position of the transformation area in device coordinate system, commonly in pixels.
topTop position of the transformation area in device coordinate system, commonly in pixels.
widthWidth of the transformation area in device coordinate system, commonly in pixels.
heightHeight of the transformation area in device coordinate system, commonly in pixels.
rotateRotation value. Please refer to e_RotationXXX values and this should be one of these values except e_RotationUnknown.
Returns
The display matrix used for current PDF page.

◆ GetDocument()

PDFDoc foxit.pdf.PDFPage.GetDocument ( )
inline

Get the PDF document, to which current PDF page belongs.

Returns
A PDF document object.

◆ GetGraphicsObjectAtPoint()

GraphicsObject foxit.pdf.PDFPage.GetGraphicsObjectAtPoint ( PointF  point,
float  tolerance,
GraphicsObject.Type  filter 
)
inline

Get the topmost graphics object in specified point, with specified type filter.

Parameters
pointA specified position, in PDF coordinate system .
toleranceTolerance value for a graphics object hit detection, in point units. It should be positive.
filterType filter that specifies which kind of graphics object is to be gotten. Please refer to e_TypeXXX values and it should be one of these values. e_TypeAll means for all kinds of graphics objects. Default value: e_TypeAll.
Returns
A GraphicsObject object. If no graphics object can be found, this function will return null.

◆ GetGraphicsObjectsAtPoint()

GraphicsObjectArray foxit.pdf.PDFPage.GetGraphicsObjectsAtPoint ( PointF  point,
float  tolerance,
GraphicsObject.Type  filter 
)
inline

Get all the graphics objects in specified point, with specified type filter.

Parameters
pointA specified position, in PDF coordinate system .
toleranceTolerance value for a graphics object hit detection, in point units. It should be positive.
filterType filter that specifies which kind of graphics object is to be gotten. Please refer to e_TypeXXX values and it should be one of these values. e_TypeAll means for all kinds of graphics objects. Default value: e_TypeAll.
Returns
An array of GraphicsObject objects.

◆ GetHeight()

float foxit.pdf.PDFPage.GetHeight ( )
inline

Get the page height.

Returns
Page height.

◆ GetIndex()

int foxit.pdf.PDFPage.GetIndex ( )
inline

Get page index.

Returns
Page index, starting from 0 and within the count of pages in related PDF document.

◆ GetInheritedAttribute()

PDFObject foxit.pdf.PDFPage.GetInheritedAttribute ( string  attruibute_name)
inline

Get the PDF object for specified attribute which may be inherited from the ancestor node in the page tree.

Some of the page attributes are designated as inheritable, such as "Resources", "MediaBox", "CropBox", and "Rotate". Please refer to "TABLE 3.27 Entries in a page object" in <PDF Reference 1.7> P145 and "Inheritance of Page Attributes" in <PDF Reference 1.7> P149 for more details.

Parameters
attruibute_nameThe name of attribute to be found.
Returns
A PDF object. If not found, this function will return null.

◆ GetResources()

PDFDictionary foxit.pdf.PDFPage.GetResources ( )
inline

Get the PDF dictionary of "Resources".

Note
Please refer to "TABLE 3.27 Entries in a page object" in <PDF Reference 1.7> P145 for more details.
Returns
The PDF dictionary of "Resources".

◆ GetRotation()

Rotation foxit.pdf.PDFPage.GetRotation ( )
inline

Get the page rotation.

Returns
Page rotation value. Please refer to e_RotationXXX values and this would be one of these values.

◆ GetThumb()

PDFStream foxit.pdf.PDFPage.GetThumb ( )
inline

Get the PDF stream of "Thumb".

Note
Please refer to "TABLE 3.27 Entries in a page object" in <PDF Reference 1.7> P146 for more details.
Returns
The PDF stream of "Thumb".

◆ GetUserUnitSize()

float foxit.pdf.PDFPage.GetUserUnitSize ( )
inline

Get the user unit.

A positive number giving the size of default user space units, in multiples of 1/72 inch. The range of supported values is implementation-dependent.

Returns
User unit.

◆ GetWidth()

float foxit.pdf.PDFPage.GetWidth ( )
inline

Get the page width.

Returns
Page width

◆ HasTransparency()

bool foxit.pdf.PDFPage.HasTransparency ( )
inline

Check whether current PDF page has transparency or not.

Before using this function, please ensure current page has been parsed.

Returns
true means current page has transparency, while false means current page does not have transparency.

◆ HasWatermark()

bool foxit.pdf.PDFPage.HasWatermark ( )
inline

Check whether the current page has any watermark (not including Foxit PDF SDK trial watermark).

Before using this function, please ensure current page has been parsed.

Returns
true means the current page has watermark, and false means the current page has no watermark.

◆ IsParsed()

bool foxit.pdf.PDFPage.IsParsed ( )
inline

Check if current page has been parsed or not.

Returns
true means current page has been parsed, while false means current page has not been parsed yet.

◆ LoadThumbnail()

System.Drawing.Bitmap foxit.pdf.PDFPage.LoadThumbnail ( )
inline

Load the thumbnail bitmap.

Returns
The thumbnail bitmap of current page. If the return value of function common::Bitmap::IsEmpty for the returned bitmap object is true, that means no thumbnail can be found.

◆ MoveAnnotToFirst()

void foxit.pdf.PDFPage.MoveAnnotToFirst ( Annot  annot)
inlinevirtual

Change specified annotation to be the first one of all annotations.

In PDF page, all the annotations are managed in an annotation list. In the annotation list, annotations with small indexes (as in the font part of the list) will be drawn to the page first, and annotations with large indexes (as in the last part of the list) will be drawn to the page later. So, in a page, if an annotation is shown on the top of other annotations in z-order, that means its index is larger than other annotations in the annotation list.
This function is used to move an annotation from current index position to the first position in the annotation list, in order to move the annotation to the bottom in z-order when displayed.

Parameters
annotAn Annot object to be moved to first. It should be in current PDF page.
Returns
None.

◆ MoveAnnotToLast()

void foxit.pdf.PDFPage.MoveAnnotToLast ( Annot  annot)
inlinevirtual

Change specified annotation to be the last one of all annotations.

In PDF page, all the annotations are managed in an annotation list. In the annotation list, annotations with small indexes (as in the font part of the list) will be drawn to the page first, and annotations with large indexes (as in the last part of the list) will be drawn to the page later. So, in a page, if an annotation is shown on the top of other annotations in z-order, that means its index is larger than other annotations in the annotation list.
This function is used to move an annotation from current index position to the last position in the annotation list, in order to move the annotation to the top in z-order when displayed.

Parameters
annotAn Annot object to be moved to last. It should be in current PDF page.
Returns
None.

◆ MoveAnnotToNext()

void foxit.pdf.PDFPage.MoveAnnotToNext ( Annot  annot)
inlinevirtual

Exchange the indexes of current annotation and its next annotation.

In PDF page, all the annotations are managed in an annotation list. In the annotation list, annotations with small indexes (as in the font part of the list) will be drawn to the page first, and annotations with large indexes (as in the last part of the list) will be drawn to the page later. So, in a page, if an annotation is shown on the top of other annotations in z-order, that means its index is larger than other annotations in the annotation list.
This function is used to exchange the indexes position of current annotation and its next annotation in the annotation list, in order to move the annotation to a lower level in z-order when displayed.

Parameters
annotAn Annot object to be moved. It should be in current PDF page.
Returns
None.

◆ MoveAnnotToPrev()

void foxit.pdf.PDFPage.MoveAnnotToPrev ( Annot  annot)
inlinevirtual

Exchange the indexes of current annotation and its previous annotation.

In PDF page, all the annotations are managed in an annotation list. In the annotation list, annotations with small indexes (as in the font part of the list) will be drawn to the page first, and annotations with large indexes (as in the last part of the list) will be drawn to the page later. So, in a page, if an annotation is shown on the top of other annotations in z-order, that means its index is larger than other annotations in the annotation list.
This function is used to exchange the indexes position of current annotation and its previous annotation in the annotation list, in order to move the annotation to a lower level in z-order when displayed.

Parameters
annotAn Annot object to be moved. It should be in current PDF page.
Returns
None.

◆ RemoveAllWatermarks()

bool foxit.pdf.PDFPage.RemoveAllWatermarks ( )
inline

Remove all watermarks.

Before using this function, please ensure current page has been parsed.

Returns
true means success, while false means failure.

◆ RemoveAnnot()

bool foxit.pdf.PDFPage.RemoveAnnot ( Annot  annot)
inline

Remove an annotation.

This function can remove any annotation returned by getting function or adding function.
But for widget annotation, this function can only remove an independent widget annotation. If the widget annotation is associated with a form field, this function cannot remove it and will throw exception {}. For a widget annotation associated with a form field, please call function interform::Form::RemoveControl to remove it along with associated form control.

Parameters
annotAn Annot object to be removed. It should be in current PDF page.
Returns
true means success, while false means failure.

◆ SetAnnotGroup()

bool foxit.pdf.PDFPage.SetAnnotGroup ( MarkupArray  annot_array,
int  header_index 
)
inline

Group all the input markup annotations together.

Markup annotations can be grouped. The group consists of a primary annotation and one or more subordinate annotations. Some entries in the primary annotation are treated as group attributes that should apply to the group as a whole; the corresponding entries in the subordinate annotations should be ignored. These entries are contents, last modification time, fill color/border color, title, pop-up annotation, creation time, subject, and open status. So user should respect the group property: when a property of an annotation in the group is changed, the other annotations in the same group should be changed too.
Operations that manipulate any annotation in a group, such as movement, cut, and copy, should be treated by viewer applications as acting on the entire group.

Parameters
annot_arrayAn array of Markup objects that specifies markup annotations which are to be grouped together. This array should contains at least 2 markup annotations, and all the markup annotations in this array should be different from others. All the markup annotations in this array should be in current page.
Specially, if a markup annotation in this array is already in another group, that group will be set to the new group with the new header as well.
header_indexThe index that specifies a markup annotation in parameter annot_array to be the header of the group. Valid range: from 0 to (ammot_count -1).
Returns
true means group input markup annotations together successfully, while false means failure.

◆ SetBox()

void foxit.pdf.PDFPage.SetBox ( PDFPage.BoxType  box_type,
RectF  box 
)
inline

Set page box.

Parameters
box_typePage box type. Please refer to e_XXXBox values and it should be one of these values.
boxNew box rectangle, in PDF coordinate system .
Returns
None.

◆ SetClipRect()

void foxit.pdf.PDFPage.SetClipRect ( RectF  clip_rect)
inline

Set clip rectangle for all graphics objects on current PDF page.

After this function finishes successfully, please re-parse current page by function pdf::PDFPage::StartParse with parameter is_reparse true.

Parameters
clip_rectNew clip rectangle, in PDF coordinate system .
Returns
None.

◆ SetRotation()

void foxit.pdf.PDFPage.SetRotation ( Rotation  rotate)
inline

Set page rotation.

Parameters
rotateNew page rotation value. Please refer to e_RotationXXX values and this should be one of these values except e_RotationUnknown.
Returns
None.

◆ SetSize() [1/2]

void foxit.pdf.PDFPage.SetSize ( float  width,
float  height 
)
inline

Set page width and height.

When changing page width/height, Foxit PDF SDK will always do as following:
First, choose "page rotation is 0" as the basis page status and choose the left-bottom corner of the page (with page rotation is 0) as the basis point. And then, always change the position of top page boundary and right page boundary (with page rotation is 0) to change page size.

Parameters
widthNew page width. It should be a positive value and the unit is 1/72 inch.
heightNew page height. It should be a positive value and the unit is 1/72 inch.
Returns
None.

◆ SetSize() [2/2]

void foxit.pdf.PDFPage.SetSize ( PDFPage.Size  size)
inline

Set page size type.

When changing page size, Foxit PDF SDK will always do as following:
First, choose "page rotation is 0" as the basis page status and choose the left-bottom corner of the page (with page rotation is 0) as the basis point. And then, always change the position of top page boundary and right page boundary (with page rotation is 0) to change page size.

Parameters
sizeSize type to specify the new size of current page. Please refer to e_SizeXXX values and this should be one of its values.
Returns
None.

◆ SetThumbnail()

void foxit.pdf.PDFPage.SetThumbnail ( System.Drawing.Bitmap  thumbnail)
inline

Set page thumbnail.

Thumbnail bitmap does not use alpha channel. So user is recommended to set a bitmap without alpha channel to be the new thumbnail. If a bitmap with alpha channel is set, the new thumbnail will use white background by default.

Parameters
thumbnailNew page thumbnail. It should be a valid bitmap.
Returns
None.

◆ SetUserUnitSize()

void foxit.pdf.PDFPage.SetUserUnitSize ( float  user_unit)
inline

Set the user unit.

A positive number giving the size of default user space units, in multiples of 1/72 inch. The range of supported values is implementation-dependent. If not set, Foxit PDF SDK will use default value 1.0 (user unit is 1/72 inch).

Parameters
user_unitA positive number giving the size of default user space units, in multiples of 1/72 inch.
Returns
None.

◆ StartParse()

Progressive foxit.pdf.PDFPage.StartParse ( int  flags,
PauseCallback  pause,
bool  is_reparse 
)
inline

Start to parse current page.

It may take a long time to parsing a PDF page, so Foxit PDF SDK uses a progressive process to do this. All the resources of page content will be loaded after the PDF page is parsed.

Parameters
flagsParsing flags. Please refer to e_ParsePageXXX values and this should be one or a combination of these values.
pausePause callback object which decides if the parsing process needs to be paused. This can be null which means not to pause during the parsing process. If this is not null, it should be a valid pause object implemented by user.
is_reparsetrue means to re-parse current page, while false means not to re-parse current page.
Returns
A Progressive object. Please check the rate of current progress by function common::Progressive::GetRateOfProgress. If the rate is not 100 yet, call function common::Progressive::Continue to coninue the progress until the progress is finished.
Note
When parameter is_reparse is set to true, that means to re-parse current PDF page, and all the retrieved graphics object's position (as POSITION object) and graphics object (as GraphicsObject object) will be invalid.
Application needs to get graphics objects again after re-parsing a PDF page.

◆ Transform()

bool foxit.pdf.PDFPage.Transform ( Matrix2D  matrix,
bool  need_transform_clip_path 
)
inline

Transform a PDF page, including annotations and form fields on the page.

Note
This function only supports scaling and translating. After this operation, please re-parse current page by function pdf::PDFPage::StartParse with parameter is_reparse true, in order that expected content will be displayed.
Parameters
matrixTransform matrix.
need_transform_clip_pathtrue means to transform the page with clip rectangle, while false means not.
Returns
true means success, while false means failure.

Foxit Software Corporation Logo
@2018 Foxit Software Incorporated. All rights reserved.