Foxit PDF SDK
|
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. More... | |
Annot | AddAnnot (Annot.Type type, RectF rect) |
Add an annotation to current PDF page. More... | |
Annot | AddAnnot (PDFDictionary annot_dict) |
Add an annotation (by a valid annotation dictionary) to current 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 an ordinary signature to PDF page. More... | |
Signature | AddSignature (RectF rect, string field_name) |
Add an ordinary signature to PDF page. More... | |
Signature | AddSignature (RectF rect, string field_name, Signature.SignatureType signature_type, bool to_check_permission) |
Add a signature to PDF page. More... | |
bool | AddText (string text, RectF rect, RichTextStyle style) |
Add text to current page. More... | |
RectF | CalcContentBBox (PDFPage.CalcMarginMode mode) |
Calculate the content area of PDF page. More... | |
void | ClearRenderCache () |
Clear render cache. 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... | |
bool | FlattenAnnot (Annot annot) |
Flatten an annotation: the annotation is made to be a part of the page contents and be removed then. 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 coordinate 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... | |
AnnotArray | GetAnnotsAtDevicePoint (PointF position, float tolerance, Matrix2D matrix) |
Get all the annotations at a specified position, in device coordinate system. More... | |
AnnotArray | GetAnnotsAtPoint (PointF position, float tolerance) |
Get all the annotations at a specified position, in PDF coordinate system. 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 | GetGraphicsObjectAtDevicePoint (PointF point, float tolerance, Matrix2D matrix, GraphicsObject.Type filter) |
Get the topmost graphics object in specified point in device coordinate system, with specified type filter. More... | |
GraphicsObject | GetGraphicsObjectAtPoint (PointF point, float tolerance, GraphicsObject.Type filter) |
Get the topmost graphics object in specified point, with specified type filter. More... | |
GraphicsObject | GetGraphicsObjectAtRectangle (RectF rect, GraphicsObject.Type filter) |
Get the topmost graphics object whose rectangle interasects with a specified rectangle, with specified type filter. More... | |
GraphicsObjectArray | GetGraphicsObjectsAtDevicePoint (PointF point, float tolerance, Matrix2D matrix, GraphicsObject.Type filter) |
Get all the graphics objects in specified point in device coordinate system, 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... | |
GraphicsObjectArray | GetGraphicsObjectsAtRectangle (RectF rect, GraphicsObject.Type filter) |
Get all the graphics objects whose rectangles intersect with a specified rectangle, 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... | |
RectF | GetSuggestedRect (Bitmap render_result, Matrix2D render_matrix, PointF point) |
Get the suggested rectangle (in PDF coordinate system) for a point (in PDF coordinatesystem") based on the rendering result bitmap. 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... | |
Bitmap | LoadThumbnail () |
Load the thumbnail bitmap. More... | |
void | MoveAnnotToFirst (Annot annot) |
Change specified annotation to be the first one of all annotations. More... | |
void | MoveAnnotToLast (Annot annot) |
Change specified annotation to be the last one of all annotations. More... | |
void | MoveAnnotToNext (Annot annot) |
Exchange the indexes of current annotation and its next annotation. More... | |
void | MoveAnnotToPrev (Annot annot) |
Exchange the indexes of current annotation and its previous annotation. More... | |
bool | Normalize () |
Transform current PDF page by undoing any rotation and removing the offset to the page's "CropBox". 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 (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, bool need_transform_annotations) |
Transform a PDF page, including annotations and form fields on the page. More... | |
void | UpdateAnnotList () |
Update the annotation list. More... | |
![]() | |
GraphicsObjects (GraphicsObjects other) | |
Constructor, with another GraphicsObjects object. More... | |
bool | GenerateContent () |
Generate contents of current graphics objects. More... | |
bool | GenerateContent (GraphicsObjects.TextMergeOption text_merge_option) |
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... | |
GraphicsObject | GetGraphicsObject (int index) |
Get a graphics object by index. More... | |
int | GetGraphicsObjectCount () |
Get the count of graphics objects in graphics object list. More... | |
int | GetGraphicsObjectIndex (GraphicsObject graphics_object) |
Get the index of a specified graphics object in graphics object list. More... | |
long | GetGraphicsObjectPosition (GraphicsObject graphics_object) |
Get the position of the specified graphics object. 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... | |
long | MoveGraphicsObjectByPosition (long current_position, long position_move_after) |
Move a graphics object from a position to another position. More... | |
bool | RemoveGraphicsObject (GraphicsObject graphics_object) |
Remove a graphics object. More... | |
bool | RemoveGraphicsObjectByPosition (long position) |
Remove a graphics object by position. More... | |
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 page object is retrieved from a PDF document by function PDFDoc.GetPage . For most case, a PDF page should be parsed first and then be used. Function PDFPage.IsParsed can be used to judge whether the PDF page has been parsed or not. For a unparsed page, please use function 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:
Class foxit.pdf.PDFPage is derived from class foxit.pdf.GraphicsObjects , so class PDFPage also offers functions to retrieve PDF graphics objects:
This class object can also be used to construct objects of other classes in order to access specified information in PDF page:
|
strong |
Enumeration for page box type.
Values of this enumeration should be used alone.
|
strong |
|
strong |
|
strong |
|
strong |
Enumeration for page size type.
Values of this enumeration should be used alone.
|
inline |
Constructor, from a PDF dictionary which represents a PDF page and the PDF document which contains the dictionary..
[in] | document | A valid PDF document. |
[in] | page_dict | A PDF dictionary of a PDF page. It should belong to the PDF document specified by parameter document. |
|
inline |
Constructor, with parent class object.
[in] | other | Parent class object. |
|
inline |
Add an annotation to current PDF page.
Currently, this function can support to add most annotation types except:
Widget, Sound, Movie, PrinterMark, TrapNet, Watermark, 3D, PSInk, Redact.
Attention:
|
inline |
Add an annotation (by a valid annotation dictionary) to current PDF page.
[in] | annot_dict | An valid annotation dictionary which is to be added as an annotation to current PDF page. |
|
inline |
Add an image to current page.
If the type of image is foxit.common.Image.Type.e_JPG , the image should be kept valid until the related document is closed.
[in] | image | An 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 foxit.common.Image.Type.e_Unknown . |
[in] | frame_index | Frame index. Valid range: from 0 to (count-1). count is returned by function common.Image.GetFrameCount . |
[in] | position | A specified position, in PDF coordinate system. |
[in] | width | The width which is used for the image to set into page. The value should be larger than 0. |
[in] | height | The height which is used for the image to set into page. The value should be larger than 0. |
[in] | auto_generate_content | true 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. |
|
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.
[in] | file_path | A full path of an existing image file. It should not be an empty string. |
[in] | position | A specified position, in PDF coordinate system. |
[in] | width | The width which is used for the image to set into page. The value should be larger than 0. |
[in] | height | The height which is used for the image to set into page. The value should be larger than 0. |
[in] | auto_generate_content | true 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. |
Add an ordinary signature to PDF page.
For a new ordinary 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 setting functions of class Signature to set other information used for signing and signed appearance.
[in] | rect | Rectangle position for the new signature, in PDF coordinate system. It should be a valid rectangle in PDF coordinate system. |
Add an ordinary signature to PDF page.
For a new ordinary 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 setting functions of class Signature to set other information used for signing and signed appearance.
[in] | rect | Rectangle position for the new signature, in PDF coordinate system. It should be a valid rectangle in PDF coordinate system. |
[in] | field_name | The signature field name. This can be an empty string. |
|
inline |
Add a signature to PDF page.
For a new ordinary signature, its filter will be "Adobe.PPKLite" and sub filter will be "adbe.pkcs7.detached" by default. For a new time stamp signature, its filter will be "Adobe.PPKLite" and sub filter will be "ETSI.RFC3161" 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 setting functions of class Signature to set other information used for signing and signed appearance.
[in] | rect | Rectangle position for the new signature, in PDF coordinate system. If parameter signature_type is foxit.pdf.Signature.SignatureType.e_SignatureTypeTimeStamp , this rectangle will be ignored; otherwise, this should be a valid rectangle in PDF coordinate system. |
[in] | field_name | The signature field name. This can be an empty string. |
[in] | signature_type | Signature type. Please refer to values starting from foxit.pdf.Signature.SignatureType.e_SignatureTypeOrdinary and this should be one of these values. |
[in] | to_check_permission | A boolean value to decide whether Foxit PDF SDK should check PDF document's permission before adding signature: true means Foxit PDF SDK should check document permission to decide if adding signature is allowed, while false means Foxit PDF SDK should not check document permission before adding signature. When this parameter is false, user should ensure to check document permission to check if adding signature is allowed. |
|
inline |
Add text to current page.
The text wraps around if it is too long to fit the rectangle.
[in] | text | Content of the new text string. This should not be an empty string. |
[in] | rect | The box rectangle, in PDF coordinate system. |
[in] | style | Style data used for the new text string. |
|
inline |
Calculate the content area of PDF page.
Before using this function, please ensure current page has been parsed.
[in] | mode | Calculation mode. It should be one of following values:
|
|
inline |
Clear render cache.
|
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:
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 values starting from foxit.pdf.annots.Annot.Flags.e_FlagInvisible 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 PDFPage.StartParse .
[in] | for_display | Decide 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. |
[in] | options | The flatten options. Please refer to values starting from foxit.pdf.PDFPage.FlattenOptions.e_FlattenAll and this should one or a combination of them. Specially, if foxit.pdf.PDFPage.FlattenOptions.e_FlattenNoAnnot and foxit.pdf.PDFPage.FlattenOptions.e_FlattenNoFormControl are used together, that means nothing is to be flatten to page and this function will return true directly. |
|
inline |
Flatten an annotation: the annotation is made to be a part of the page contents and be removed then.
After flattening the annotation successfully, user should re-parse this page by function PDFPage.StartParse .
[in] | annot | An annotation to be flattened and removed. |
|
inline |
Get an annotation by index.
[in] | index | Annotation index. Valid range: from 0 to (count-1). count is returned by function PDFPage.GetAnnotCount . |
|
inline |
Get the annotation at a specified position, in device coordinate system.
If there are several annotations in this specified position, this function will always return the topmost annotation. Annotations with flag foxit.pdf.annots.Annot.Flags.e_FlagNoView or foxit.pdf.annots.Annot.Flags.e_FlagHidden or foxit.pdf.annots.Annot.Flags.e_FlagInvisible will not be retrieved by this function.If the returned annotation has a flag foxit.pdf.annots.Annot.Flags.e_FlagReadOnly ,it cannot be modified.
[in] | position | The specified position, in device coordinate system. |
[in] | tolerance | Tolerance value. Valid range: 0.0f to 30.0f. |
[in] | matrix | The transformation matrix. Usually this is returned by function PDFPage.GetDisplayMatrix . If this is null, current function will have the same feature as function PDFPage.GetAnnotAtPoint . |
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 foxit.pdf.annots.Annot.Flags.e_FlagNoView or foxit.pdf.annots.Annot.Flags.e_FlagHidden or foxit.pdf.annots.Annot.Flags.e_FlagInvisible will not be retrieved by this function. If the returned annotation has a flag foxit.pdf.annots.Annot.Flags.e_FlagReadOnly ,it cannot be modified.
[in] | position | The specified position, in PDF coordinate system. |
[in] | tolerance | Tolerance value. Valid range: 0.0f to 30.0f. |
|
inline |
Get the count of annotations.
|
inline |
Get the PDF array of "Annots".
|
inline |
Get all the annotations at a specified position, in device coordinate system.
In one specified position, there may exist several annotations. This function can be used to retrieve all these annotations in the specified position. Annotations with flag foxit.pdf.annots.Annot.Flags.e_FlagNoView or foxit.pdf.annots.Annot.Flags.e_FlagHidden or foxit.pdf.annots.Annot.Flags.e_FlagInvisible will not be retrieved by this function.
If the return annotation object of function annots.AnnotArray.GetAt for the returned annotation array object has flag foxit.pdf.annots.Annot.Flags.e_FlagReadOnly , that means the annotation cannot be modified.
[in] | position | The specified position, in device coordinate system. |
[in] | tolerance | Tolerance value. Valid range: 0.0f to 30.0f. |
[in] | matrix | The transformation matrix. Usually this is returned by function PDFPage.GetDisplayMatrix . If this is null, current function will have the same feature as function PDFPage.GetAnnotAtPoint . |
|
inline |
Get all the annotations at a specified position, in PDF coordinate system.
In one specified position, there may exist several annotations. This function can be used to retrieve all these annotations in the specified position. Annotations with flag foxit.pdf.annots.Annot.Flags.e_FlagNoView or foxit.pdf.annots.Annot.Flags.e_FlagHidden or foxit.pdf.annots.Annot.Flags.e_FlagInvisible will not be retrieved by this function.
If the return annotation object of function annots.AnnotArray.GetAt for the returned annotation array object has flag foxit.pdf.annots.Annot.Flags.e_FlagReadOnly , that means the annotation cannot be modified.
[in] | position | The specified position, in PDF coordinate system. |
[in] | tolerance | Tolerance value. Valid range: 0.0f to 30.0f. |
|
inline |
Get page box.
[in] | box_type | Page box type. Please refer to values starting from foxit.pdf.PDFPage.BoxType.e_MediaBox and this should be one of these values. |
|
inline |
Get the PDF object of "Contents".
|
inline |
Get the page dictionary.
|
inline |
Get the display matrix of PDF page, from PDF coordinate system to targeted device coordinate system.
[in] | left | Left position of the transformation area in device coordinate system, commonly in pixels. |
[in] | top | Top position of the transformation area in device coordinate system, commonly in pixels. |
[in] | width | Width of the transformation area in device coordinate system, commonly in pixels. |
[in] | height | Height of the transformation area in device coordinate system, commonly in pixels. |
[in] | rotate | Rotation value. Please refer to values starting from foxit.common.Rotation.e_Rotation0 and this should be one of these values except foxit.common.Rotation.e_RotationUnknown . |
|
inline |
Get the PDF document, to which current PDF page belongs.
|
inline |
Get the topmost graphics object in specified point in device coordinate system, with specified type filter.
[in] | point | A specified position, in device coordinate system. |
[in] | tolerance | Tolerance value for a graphics object hit detection, in point units. It should be positive. |
[in] | matrix | The transformation matrix. Usually this is returned by function PDFPage.GetDisplayMatrix . |
[in] | filter | Type filter that specifies which kind of graphics object is to be gotten. Please refer to values starting from foxit.pdf.graphics.GraphicsObject.Type.e_TypeAll and this should be one of these values. foxit.pdf.graphics.GraphicsObject.Type.e_TypeAll means for all kinds of graphics objects. |
|
inline |
Get the topmost graphics object in specified point, with specified type filter.
[in] | point | A specified position, in PDF coordinate system. |
[in] | tolerance | Tolerance value for a graphics object hit detection, in point units. It should be positive. |
[in] | filter | Type filter that specifies which kind of graphics object is to be gotten. Please refer to values starting from foxit.pdf.graphics.GraphicsObject.Type.e_TypeAll and this should be one of these values. foxit.pdf.graphics.GraphicsObject.Type.e_TypeAll means for all kinds of graphics objects. |
|
inline |
Get the topmost graphics object whose rectangle interasects with a specified rectangle, with specified type filter.
[in] | rect | A specified rectangle, in PDF coordinate system. |
[in] | filter | Type filter that specifies which kind of graphics object is to be gotten. Please refer to values starting from foxit.pdf.graphics.GraphicsObject.Type.e_TypeAll and this should be one of these values. foxit.pdf.graphics.GraphicsObject.Type.e_TypeAll means for all kinds of graphics objects. |
|
inline |
Get all the graphics objects in specified point in device coordinate system, with specified type filter.
[in] | point | A specified position, in device coordinate system. |
[in] | tolerance | Tolerance value for a graphics object hit detection, in point units. It should be positive. |
[in] | matrix | The transformation matrix. Usually this is returned by function PDFPage.GetDisplayMatrix . |
[in] | filter | Type filter that specifies which kind of graphics object is to be gotten. Please refer to values starting from foxit.pdf.graphics.GraphicsObject.Type.e_TypeAll and this should be one of these values. foxit.pdf.graphics.GraphicsObject.Type.e_TypeAll means for all kinds of graphics objects. |
|
inline |
Get all the graphics objects in specified point, with specified type filter.
[in] | point | A specified position, in PDF coordinate system. |
[in] | tolerance | Tolerance value for a graphics object hit detection, in point units. It should be positive. |
[in] | filter | Type filter that specifies which kind of graphics object is to be gotten. Please refer to values starting from foxit.pdf.graphics.GraphicsObject.Type.e_TypeAll and this should be one of these values. foxit.pdf.graphics.GraphicsObject.Type.e_TypeAll means for all kinds of graphics objects. |
|
inline |
Get all the graphics objects whose rectangles intersect with a specified rectangle, with specified type filter.
[in] | rect | A specified rectangle, in PDF coordinate system. |
[in] | filter | Type filter that specifies which kind of graphics object is to be gotten. Please refer to values starting from foxit.pdf.graphics.GraphicsObject.Type.e_TypeAll and this should be one of these values. foxit.pdf.graphics.GraphicsObject.Type.e_TypeAll means for all kinds of graphics objects. |
|
inline |
Get the page height.
|
inline |
Get page index.
|
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.
[in] | attruibute_name | The name of attribute to be found. |
|
inline |
Get the PDF dictionary of "Resources".
|
inline |
Get the page rotation.
|
inline |
Get the suggested rectangle (in PDF coordinate system) for a point (in PDF coordinatesystem") based on the rendering result bitmap.
This function can help user to locate a rectangle area (as a suggested rectangle) around a specified point. When a valid suggested rectangle is retrieved, user can use the rectangle to add something to PDF page, such as a new annotation, a new form field, a new signature and etc.
The suggested rectangle for a point means a rectangle which contains specified point and can be drawn in the spare place around the specified point as large as possible. BUT, if any of left/right/top/bottom directions from the point reaches the input bitmap edges directly, no suggested rectangle can be retrieved.
This function does not support a Rbg565 bitmap. If input bitmap is a Rbg565 bitmap, this function will return an empty rectangle directly.
[in] | render_result | Bitmap as the result of rendering current PDF page. This should be a valid bitmap object. |
[in] | render_matrix | The transformation matrix used for rendering current PDF page and generating parameter render_result as rendering result. |
[in] | point | A point (in PDF coordinate system) for which a suggested rectangle is to be found. |
|
inline |
Get the PDF stream of "Thumb".
|
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.
|
inline |
Get the page width.
|
inline |
Check whether current PDF page has transparency or not.
Before using this function, please ensure current page has been parsed.
|
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.
|
inline |
Check if current page has been parsed or not.
|
inline |
Load the thumbnail bitmap.
|
inline |
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.
[in] | annot | An annotation object to be moved to first. It should be in current PDF page. |
|
inline |
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.
[in] | annot | An annotation object to be moved to last. It should be in current PDF page. |
|
inline |
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 an upper level in z-order when displayed.
[in] | annot | An annotation object to be moved. It should be in current PDF page. |
|
inline |
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.
[in] | annot | An annotation object to be moved. It should be in current PDF page. |
|
inline |
Transform current PDF page by undoing any rotation and removing the offset to the page's "CropBox".
|
inline |
Remove all watermarks.
Before using this function, please ensure current page has been parsed.
|
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 foxit.common.ErrorCode.e_ErrUnsupported .
For a widget annotation associated with a form field, please call function interform.Form.RemoveControl to remove it along with associated form control.
[in] | annot | An annotation object to be removed. It should be in current PDF page. |
|
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.
[in] | annot_array | An 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. |
[in] | header_index | The index that specifies a markup annotation in parameter annot_array to be the header of the group. Valid range: from 0 to (annot_count -1). |
|
inline |
Set page box.
[in] | box_type | Page box type. Please refer to values starting from foxit.pdf.PDFPage.BoxType.e_MediaBox and this should be one of these values. |
[in] | box | New box rectangle, in PDF coordinate system. |
|
inline |
Set clip rectangle for all graphics objects on current PDF page.
After this function finishes successfully, please re-parse current page by function PDFPage.StartParse with parameter is_reparse true.
[in] | clip_rect | New clip rectangle, in PDF coordinate system. |
|
inline |
Set page rotation.
[in] | rotate | New page rotation value. Please refer to values starting from foxit.common.Rotation.e_Rotation0 and this should be one of these values except foxit.common.Rotation.e_RotationUnknown . |
|
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.
[in] | width | New page width. It should be a positive value and the unit is 1/72 inch. |
[in] | height | New page height. It should be a positive value and the unit is 1/72 inch. |
|
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.
[in] | size | Size type to specify the new size of current page. Please refer to values starting from foxit.pdf.PDFPage.Size.e_SizeLetter and this should be one of these values. |
|
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.
[in] | thumbnail | New page thumbnail. It should be a valid bitmap. |
|
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).
[in] | user_unit | A positive number giving the size of default user space units, in multiples of 1/72 inch. |
|
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.
[in] | flags | Parsing flags. Please refer to values starting from foxit.pdf.PDFPage.ParseFlags.e_ParsePageNormal and this should be one or a combination of these values. |
[in] | pause | Pause 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. |
[in] | is_reparse | true means to re-parse current page, while false means not to re-parse current page. |
|
inline |
Transform a PDF page, including annotations and form fields on the page.
[in] | matrix | Transform matrix. |
[in] | need_transform_clip_path | true means to transform the page with clip rectangle, while false means not. |
[in] | need_transform_annotations | true means to transform the page with annotations. while false means not. |
|
inline |
Update the annotation list.
If any annotation is modified(added/removed...) by changing "Annots" dictionary item directly, please call this function to update the annotation list after the changing.