Public Member Functions | |
PDFPage (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 (int type, RectF rect) throws com.foxit.sdk.PDFException |
Add an annotation to PDF page. More... | |
boolean | addImage (Image image, int frame_index, PointF position, float width, float height, boolean auto_generate_content) throws com.foxit.sdk.PDFException |
Add an image to current page. More... | |
boolean | addImageFromFilePath (String file_path, PointF position, float width, float height, boolean auto_generate_content) throws com.foxit.sdk.PDFException |
Add an image to current page from file path. More... | |
Signature | addSignature (RectF rect) throws com.foxit.sdk.PDFException |
Add a signature to PDF page. More... | |
RectF | calcContentBBox (int mode) throws com.foxit.sdk.PDFException |
Calculate the content area of PDF page. More... | |
boolean | flatten (boolean for_display, int options) throws com.foxit.sdk.PDFException |
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) throws com.foxit.sdk.PDFException |
Get an annotation by index. More... | |
Annot | getAnnotAtDevicePoint (PointF position, float tolerance, Matrix2D matrix) throws com.foxit.sdk.PDFException |
Get the annotation at a specified position, in device coordination system. More... | |
Annot | getAnnotAtPoint (PointF position, float tolerance) throws com.foxit.sdk.PDFException |
Get the annotation at a specified position, in PDF coordinate system . More... | |
int | getAnnotCount () throws com.foxit.sdk.PDFException |
Get the count of annotations. More... | |
PDFArray | getAnnots () throws com.foxit.sdk.PDFException |
Get the PDF array of "Annots". More... | |
RectF | getBox (int box_type) throws com.foxit.sdk.PDFException |
Get page box. More... | |
PDFObject | getContents () throws com.foxit.sdk.PDFException |
Get the PDF object of "Contents". More... | |
PDFDictionary | getDict () throws com.foxit.sdk.PDFException |
Get the page dictionary. More... | |
Matrix2D | getDisplayMatrix (int left, int top, int width, int height, int rotate) throws com.foxit.sdk.PDFException |
Get the display matrix of PDF page, from PDF coordinate system to targeted device coordinate system. More... | |
PDFDoc | getDocument () throws com.foxit.sdk.PDFException |
Get the PDF document, to which current PDF page belongs. More... | |
GraphicsObject | getGraphicsObjectAtPoint (PointF point, float tolerance, int filter) throws com.foxit.sdk.PDFException |
Get the topmost graphics object in specified point, with specified type filter. More... | |
GraphicsObjectArray | getGraphicsObjectsAtPoint (PointF point, float tolerance, int filter) throws com.foxit.sdk.PDFException |
Get all the graphics objects in specified point, with specified type filter. More... | |
float | getHeight () throws com.foxit.sdk.PDFException |
Get the page height. More... | |
int | getIndex () throws com.foxit.sdk.PDFException |
Get page index. More... | |
PDFObject | getInheritedAttribute (String attruibute_name) throws com.foxit.sdk.PDFException |
Get the PDF object for specified attribute which may be inherited from the ancestor node in the page tree. More... | |
PDFDictionary | getResources () throws com.foxit.sdk.PDFException |
Get the PDF dictionary of "Resources". More... | |
int | getRotation () throws com.foxit.sdk.PDFException |
Get the page rotation. More... | |
PDFStream | getThumb () throws com.foxit.sdk.PDFException |
Get the PDF stream of "Thumb". More... | |
float | getUserUnitSize () throws com.foxit.sdk.PDFException |
Get the user unit. More... | |
float | getWidth () throws com.foxit.sdk.PDFException |
Get the page width. More... | |
boolean | hasTransparency () throws com.foxit.sdk.PDFException |
Check whether current PDF page has transparency or not. More... | |
boolean | hasWatermark () throws com.foxit.sdk.PDFException |
Check whether the current page has any watermark (not including Foxit PDF SDK trial watermark). More... | |
boolean | isParsed () throws com.foxit.sdk.PDFException |
Check if current page has been parsed or not. More... | |
Bitmap | loadThumbnail () throws com.foxit.sdk.PDFException |
Load the thumbnail bitmap. More... | |
void | moveAnnotToFirst (Annot annot) throws com.foxit.sdk.PDFException |
Change specified annotation to be the first one of all annotations. More... | |
void | moveAnnotToLast (Annot annot) throws com.foxit.sdk.PDFException |
Change specified annotation to be the last one of all annotations. More... | |
void | moveAnnotToNext (Annot annot) throws com.foxit.sdk.PDFException |
Exchange the indexes of current annotation and its next annotation. More... | |
void | moveAnnotToPrev (Annot annot) throws com.foxit.sdk.PDFException |
Exchange the indexes of current annotation and its previous annotation. More... | |
boolean | removeAllWatermarks () throws com.foxit.sdk.PDFException |
Remove all watermarks. More... | |
boolean | removeAnnot (Annot annot) throws com.foxit.sdk.PDFException |
Remove an annotation. More... | |
boolean | setAnnotGroup (MarkupArray annot_array, int header_index) throws com.foxit.sdk.PDFException |
Group all the input markup annotations together. More... | |
void | setBox (int box_type, RectF box) throws com.foxit.sdk.PDFException |
Set page box. More... | |
void | setClipRect (RectF clip_rect) throws com.foxit.sdk.PDFException |
Set clip rectangle for all graphics objects on current PDF page. More... | |
void | setRotation (int rotate) throws com.foxit.sdk.PDFException |
Set page rotation. More... | |
void | setSize (float width, float height) throws com.foxit.sdk.PDFException |
Set page width and height. More... | |
void | setSize (int size) throws com.foxit.sdk.PDFException |
Set page size type. More... | |
void | setThumbnail (Bitmap thumbnail) throws com.foxit.sdk.PDFException |
Set page thumbnail. More... | |
void | setUserUnitSize (float user_unit) throws com.foxit.sdk.PDFException |
Set the user unit. More... | |
Progressive | startParse (int flags, PauseCallback pause, boolean is_reparse) throws com.foxit.sdk.PDFException |
Start to parse current page. More... | |
boolean | transform (Matrix2D matrix, boolean need_transform_clip_path) throws com.foxit.sdk.PDFException |
Transform a PDF page, including annotations and form fields on the page. More... | |
![]() | |
GraphicsObjects (GraphicsObjects other) | |
Constructor, with another GraphicsObjects object. More... | |
boolean | generateContent () throws com.foxit.sdk.PDFException |
Generate contents of current graphics objects. More... | |
long | getFirstGraphicsObjectPosition (int filter) throws com.foxit.sdk.PDFException |
Get the position of first graphics object in graphics object list, based on type filter. More... | |
GraphicsObject | getGraphicsObject (long position) throws com.foxit.sdk.PDFException |
Get the graphics object by position in graphics object list. More... | |
long | getLastGraphicsObjectPosition (int filter) throws com.foxit.sdk.PDFException |
Get the position of last graphics object in graphics object list, based on type filter. More... | |
long | getNextGraphicsObjectPosition (long position, int filter) throws com.foxit.sdk.PDFException |
Get the position of next graphics object in graphics object list, based on type filter and specified current position. More... | |
long | getPrevGraphicsObjectPosition (long position, int filter) throws com.foxit.sdk.PDFException |
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) throws com.foxit.sdk.PDFException |
Insert a graphics object after the specified position. More... | |
boolean | isEmpty () |
Check whether current object is empty or not. More... | |
boolean | removeGraphicsObject (GraphicsObject graphics_object) throws com.foxit.sdk.PDFException |
Remove a graphics object. More... | |
boolean | removeGraphicsObjectByPosition (long position) throws com.foxit.sdk.PDFException |
Remove a graphics object by position. More... | |
Static Public Attributes | |
static final int | e_ArtBox = 3 |
Art Box for page boundary. More... | |
static final int | e_BleedBox = 4 |
Bleed Box for page boundary. More... | |
static final int | e_CalcContentsBox = 0 |
Calculate margin according to bounding box of all contents. | |
static final int | e_CalcDetection = 1 |
Calculate margin by detecting paths or images. | |
static final int | e_CropBox = 1 |
Crop Box for page boundary. More... | |
static final int | e_FlattenAll = 0 |
Flatten all contents of a PDF page. | |
static final int | e_FlattenNoAnnot = 0x0001 |
Flatten a PDF page without annotations. | |
static final int | e_FlattenNoFormControl = 0x0002 |
Flatten a PDF page without form controls. | |
static final int | e_MediaBox = 0 |
Media Box for page boundary. More... | |
static final int | e_ParsePageNormal = 0x0000 |
Parsing flag for normal mode, which means to parse all the contents in a PDF page. | |
static final int | e_ParsePageTextOnly = 0x0001 |
Parsing flag for text-only mode. | |
static final int | e_SizeA2 = 3 |
Page size: A2. | |
static final int | e_SizeA3 = 4 |
Page size: A3. | |
static final int | e_SizeA4 = 5 |
Page size: A4. | |
static final int | e_SizeA5 = 6 |
Page size: A5. | |
static final int | e_SizeA6 = 7 |
Page size: A6. | |
static final int | e_SizeB2 = 8 |
Page size: B2. | |
static final int | e_SizeB3 = 9 |
Page size: B3. | |
static final int | e_SizeB4 = 10 |
Page size: B4. | |
static final int | e_SizeB5 = 11 |
Page size: B5. | |
static final int | e_SizeB6 = 12 |
Page size: B6. | |
static final int | e_SizeLegal = 2 |
Page size: legal. | |
static final int | e_SizeLetter = 1 |
Page size: letter. | |
static final int | e_TrimBox = 2 |
Trim Box for page boundary. 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::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.
com.foxit.sdk.pdf.PDFPage.PDFPage | ( | PDFDoc | document, |
PDFDictionary | page_dict | ||
) |
Constructor, from a PDF dictionary which represents a PDF page and the PDF document which contains the dictionary..
document | A valid PDF document. |
page_dict | A PDF dictionary of a PDF page. It should belong to the PDF document specified by parameter document. |
com.foxit.sdk.pdf.PDFPage.PDFPage | ( | GraphicsObjects | other | ) |
Constructor, with parent class object.
other | Parent class object. |
Annot com.foxit.sdk.pdf.PDFPage.addAnnot | ( | int | type, |
RectF | rect | ||
) | throws com.foxit.sdk.PDFException |
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.
type | The type of annotation to be added. Please refer to values starting from annots::e_Note and this should be one of these values except annots::e_PSInk, annots::e_Sound, annots::e_Movie, annots::e_Widget, annots::e_PrinterMark, annots::e_TrapNet, annots::e_Watermark, annots::e_3D. |
rect | Rectangle of the new annotation. For annotation in following type, they needs a valid rectangle when being added. So for them, rect should be valid: annots::e_Note, annots::e_Link, annots::e_Square, annots::e_Circle, annots::e_FreeText, annots::e_Stamp, annots::e_Caret, annots::e_FileAttachment, annots::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. |
boolean com.foxit.sdk.pdf.PDFPage.addImage | ( | Image | image, |
int | frame_index, | ||
PointF | position, | ||
float | width, | ||
float | height, | ||
boolean | auto_generate_content | ||
) | throws com.foxit.sdk.PDFException |
Add an image to current page.
If the type of image is common::e_JPG, the image should be kept valid until the related document is closed.
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 common::e_Unknown. |
frame_index | Frame index. Valid range: from 0 to (count-1). count is returned by function common::Image::getFrameCount. |
position | A specified position, in PDF coordinate system . |
width | The width which is used for the image to set into page. The value should be larger than 0. |
height | The height which is used for the image to set into page. The value should be larger than 0. |
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. |
boolean com.foxit.sdk.pdf.PDFPage.addImageFromFilePath | ( | String | file_path, |
PointF | position, | ||
float | width, | ||
float | height, | ||
boolean | auto_generate_content | ||
) | throws com.foxit.sdk.PDFException |
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.
file_path | A full path of an existing image file. It should not be an empty string. |
position | A specified position, in PDF coordinate system . |
width | The width which is used for the image to set into page. The value should be larger than 0. |
height | The height which is used for the image to set into page. The value should be larger than 0. |
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. |
Signature com.foxit.sdk.pdf.PDFPage.addSignature | ( | RectF | rect | ) | throws com.foxit.sdk.PDFException |
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.
rect | Rectangle position for the new signature, in PDF coordinate system . It should be a valid rectangle in PDF coordinate system . |
RectF com.foxit.sdk.pdf.PDFPage.calcContentBBox | ( | int | mode | ) | throws com.foxit.sdk.PDFException |
Calculate the content area of PDF page.
Before using this function, please ensure current page has been parsed.
mode | Calculation 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. |
boolean com.foxit.sdk.pdf.PDFPage.flatten | ( | boolean | for_display, |
int | options | ||
) | throws com.foxit.sdk.PDFException |
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 values starting from annots::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 pdf::PDFPage::startParse.
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. |
options | The flatten options. Please refer to values starting from e_FlattenAll and this 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. |
Annot com.foxit.sdk.pdf.PDFPage.getAnnot | ( | int | index | ) | throws com.foxit.sdk.PDFException |
Get an annotation by index.
index | Annotation index. Valid range: from 0 to (count-1). count is returned by function PDFPage::getAnnotCount. |
Annot com.foxit.sdk.pdf.PDFPage.getAnnotAtDevicePoint | ( | PointF | position, |
float | tolerance, | ||
Matrix2D | matrix | ||
) | throws com.foxit.sdk.PDFException |
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 annots::e_FlagNoView or annots::e_FlagReadOnly or annots::e_FlagHidden or annots::e_FlagInvisible will not be retrieved by this function.
position | The specified position, in device coordinate system. |
tolerance | Tolerance value. Valid range: 0.0f to 30.0f. |
matrix | The 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. |
Annot com.foxit.sdk.pdf.PDFPage.getAnnotAtPoint | ( | PointF | position, |
float | tolerance | ||
) | throws com.foxit.sdk.PDFException |
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 annots::e_FlagNoView or annots::e_FlagReadOnly or annots::e_FlagHidden or annots::e_FlagInvisible will not be retrieved by this function.
position | The specified position, in PDF coordinate system . |
tolerance | Tolerance value. Valid range: 0.0f to 30.0f. |
int com.foxit.sdk.pdf.PDFPage.getAnnotCount | ( | ) | throws com.foxit.sdk.PDFException |
Get the count of annotations.
PDFArray com.foxit.sdk.pdf.PDFPage.getAnnots | ( | ) | throws com.foxit.sdk.PDFException |
Get the PDF array of "Annots".
RectF com.foxit.sdk.pdf.PDFPage.getBox | ( | int | box_type | ) | throws com.foxit.sdk.PDFException |
Get page box.
box_type | Page box type. Please refer to values starting from e_MediaBox and this should be one of these values. |
PDFObject com.foxit.sdk.pdf.PDFPage.getContents | ( | ) | throws com.foxit.sdk.PDFException |
Get the PDF object of "Contents".
PDFDictionary com.foxit.sdk.pdf.PDFPage.getDict | ( | ) | throws com.foxit.sdk.PDFException |
Get the page dictionary.
Matrix2D com.foxit.sdk.pdf.PDFPage.getDisplayMatrix | ( | int | left, |
int | top, | ||
int | width, | ||
int | height, | ||
int | rotate | ||
) | throws com.foxit.sdk.PDFException |
Get the display matrix of PDF page, from PDF coordinate system to targeted device coordinate system.
left | Left position of the transformation area in device coordinate system, commonly in pixels. |
top | Top position of the transformation area in device coordinate system, commonly in pixels. |
width | Width of the transformation area in device coordinate system, commonly in pixels. |
height | Height of the transformation area in device coordinate system, commonly in pixels. |
rotate | Rotation value. Please refer to values starting from e_Rotation0 and this should be one of these values except e_RotationUnknown. |
PDFDoc com.foxit.sdk.pdf.PDFPage.getDocument | ( | ) | throws com.foxit.sdk.PDFException |
Get the PDF document, to which current PDF page belongs.
GraphicsObject com.foxit.sdk.pdf.PDFPage.getGraphicsObjectAtPoint | ( | PointF | point, |
float | tolerance, | ||
int | filter | ||
) | throws com.foxit.sdk.PDFException |
Get the topmost graphics object in specified point, with specified type filter.
point | A specified position, in PDF coordinate system . |
tolerance | Tolerance value for a graphics object hit detection, in point units. It should be positive. |
filter | Type filter that specifies which kind of graphics object is to be gotten. Please refer to values starting from graphics::e_TypeAll and this should be one of these values. graphics::e_TypeAll means for all kinds of graphics objects. |
GraphicsObjectArray com.foxit.sdk.pdf.PDFPage.getGraphicsObjectsAtPoint | ( | PointF | point, |
float | tolerance, | ||
int | filter | ||
) | throws com.foxit.sdk.PDFException |
Get all the graphics objects in specified point, with specified type filter.
point | A specified position, in PDF coordinate system . |
tolerance | Tolerance value for a graphics object hit detection, in point units. It should be positive. |
filter | Type filter that specifies which kind of graphics object is to be gotten. Please refer to values starting from graphics::e_TypeAll and this should be one of these values. graphics::e_TypeAll means for all kinds of graphics objects. |
float com.foxit.sdk.pdf.PDFPage.getHeight | ( | ) | throws com.foxit.sdk.PDFException |
Get the page height.
int com.foxit.sdk.pdf.PDFPage.getIndex | ( | ) | throws com.foxit.sdk.PDFException |
Get page index.
PDFObject com.foxit.sdk.pdf.PDFPage.getInheritedAttribute | ( | String | attruibute_name | ) | throws com.foxit.sdk.PDFException |
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.
attruibute_name | The name of attribute to be found. |
PDFDictionary com.foxit.sdk.pdf.PDFPage.getResources | ( | ) | throws com.foxit.sdk.PDFException |
Get the PDF dictionary of "Resources".
int com.foxit.sdk.pdf.PDFPage.getRotation | ( | ) | throws com.foxit.sdk.PDFException |
Get the page rotation.
PDFStream com.foxit.sdk.pdf.PDFPage.getThumb | ( | ) | throws com.foxit.sdk.PDFException |
Get the PDF stream of "Thumb".
float com.foxit.sdk.pdf.PDFPage.getUserUnitSize | ( | ) | throws com.foxit.sdk.PDFException |
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.
float com.foxit.sdk.pdf.PDFPage.getWidth | ( | ) | throws com.foxit.sdk.PDFException |
Get the page width.
boolean com.foxit.sdk.pdf.PDFPage.hasTransparency | ( | ) | throws com.foxit.sdk.PDFException |
Check whether current PDF page has transparency or not.
Before using this function, please ensure current page has been parsed.
boolean com.foxit.sdk.pdf.PDFPage.hasWatermark | ( | ) | throws com.foxit.sdk.PDFException |
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.
boolean com.foxit.sdk.pdf.PDFPage.isParsed | ( | ) | throws com.foxit.sdk.PDFException |
Check if current page has been parsed or not.
Bitmap com.foxit.sdk.pdf.PDFPage.loadThumbnail | ( | ) | throws com.foxit.sdk.PDFException |
Load the thumbnail bitmap.
void com.foxit.sdk.pdf.PDFPage.moveAnnotToFirst | ( | Annot | annot | ) | throws com.foxit.sdk.PDFException |
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.
annot | An Annot object to be moved to first. It should be in current PDF page. |
void com.foxit.sdk.pdf.PDFPage.moveAnnotToLast | ( | Annot | annot | ) | throws com.foxit.sdk.PDFException |
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.
annot | An Annot object to be moved to last. It should be in current PDF page. |
void com.foxit.sdk.pdf.PDFPage.moveAnnotToNext | ( | Annot | annot | ) | throws com.foxit.sdk.PDFException |
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.
annot | An Annot object to be moved. It should be in current PDF page. |
void com.foxit.sdk.pdf.PDFPage.moveAnnotToPrev | ( | Annot | annot | ) | throws com.foxit.sdk.PDFException |
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.
annot | An Annot object to be moved. It should be in current PDF page. |
boolean com.foxit.sdk.pdf.PDFPage.removeAllWatermarks | ( | ) | throws com.foxit.sdk.PDFException |
Remove all watermarks.
Before using this function, please ensure current page has been parsed.
boolean com.foxit.sdk.pdf.PDFPage.removeAnnot | ( | Annot | annot | ) | throws com.foxit.sdk.PDFException |
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 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.
annot | An Annot object to be removed. It should be in current PDF page. |
boolean com.foxit.sdk.pdf.PDFPage.setAnnotGroup | ( | MarkupArray | annot_array, |
int | header_index | ||
) | throws com.foxit.sdk.PDFException |
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.
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. |
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 (ammot_count -1). |
void com.foxit.sdk.pdf.PDFPage.setBox | ( | int | box_type, |
RectF | box | ||
) | throws com.foxit.sdk.PDFException |
Set page box.
box_type | Page box type. Please refer to values starting from e_MediaBox and this should be one of these values. |
box | New box rectangle, in PDF coordinate system . |
void com.foxit.sdk.pdf.PDFPage.setClipRect | ( | RectF | clip_rect | ) | throws com.foxit.sdk.PDFException |
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.
clip_rect | New clip rectangle, in PDF coordinate system . |
void com.foxit.sdk.pdf.PDFPage.setRotation | ( | int | rotate | ) | throws com.foxit.sdk.PDFException |
Set page rotation.
rotate | New page rotation value. Please refer to values starting from e_Rotation0 and this should be one of these values except e_RotationUnknown. |
void com.foxit.sdk.pdf.PDFPage.setSize | ( | float | width, |
float | height | ||
) | throws com.foxit.sdk.PDFException |
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.
width | New page width. It should be a positive value and the unit is 1/72 inch. |
height | New page height. It should be a positive value and the unit is 1/72 inch. |
void com.foxit.sdk.pdf.PDFPage.setSize | ( | int | size | ) | throws com.foxit.sdk.PDFException |
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.
size | Size type to specify the new size of current page. Please refer to values starting from e_SizeLetter and this should be one of these values. |
void com.foxit.sdk.pdf.PDFPage.setThumbnail | ( | Bitmap | thumbnail | ) | throws com.foxit.sdk.PDFException |
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.
thumbnail | New page thumbnail. It should be a valid bitmap. |
void com.foxit.sdk.pdf.PDFPage.setUserUnitSize | ( | float | user_unit | ) | throws com.foxit.sdk.PDFException |
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).
user_unit | A positive number giving the size of default user space units, in multiples of 1/72 inch. |
Progressive com.foxit.sdk.pdf.PDFPage.startParse | ( | int | flags, |
PauseCallback | pause, | ||
boolean | is_reparse | ||
) | throws com.foxit.sdk.PDFException |
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.
flags | Parsing flags. Please refer to values starting from e_ParsePageNormal and this should be one or a combination of these values. |
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. |
is_reparse | true means to re-parse current page, while false means not to re-parse current page. |
boolean com.foxit.sdk.pdf.PDFPage.transform | ( | Matrix2D | matrix, |
boolean | need_transform_clip_path | ||
) | throws com.foxit.sdk.PDFException |
Transform a PDF page, including annotations and form fields on the page.
matrix | Transform matrix. |
need_transform_clip_path | true means to transform the page with clip rectangle, while false means not. |
|
static |
Art Box for page boundary.
The intended dimensions of a finished page after trimming.
|
static |
Bleed Box for page boundary.
The extent of page's meaningful content (including potential white space) as intended by page's creator.
|
static |
Crop Box for page boundary.
The region to which the contents of page are to be clipped (cropped) while displaying or printing.
|
static |
Media Box for page boundary.
The boundary of the physical medium on which page is to be displayed or printed.
|
static |
Trim Box for page boundary.
The region to which the contents of page should be clipped while outputting in a production environment.