public class CPDFPage
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
CPDFPage.PageSize
Standard page size.
|
static class |
CPDFPage.PDFDisplayBox
Not in use
|
static class |
CPDFPage.PDFFlattenOption
flatten options
|
Modifier and Type | Field and Description |
---|---|
static java.lang.Object |
lockObj |
Modifier and Type | Method and Description |
---|---|
CPDFAnnotation |
addAnnot(CPDFAnnotation.Type type)
Adds annotations on page according to the type of annotation, more:
CPDFAnnotation.Type |
void |
addAnnot(CPDFAnnotation annotation) |
CPDFWidget |
addFormWidget(CPDFWidget.WidgetType type)
Adds a form widget on the page according to the type of form widgets.
|
boolean |
applyRedactions()
Applies redaction annotations in current page.
|
void |
close()
When the object is no longer in use, call this method to release resources.
|
android.graphics.PointF |
convertPointFromPage(boolean isCropMode,
float showWidth,
float showHeight,
android.graphics.PointF srcPoint)
Converts PDF page coordinates to device coordinates.
|
android.graphics.PointF |
convertPointToPage(boolean isCropMode,
float showWidth,
float showHeight,
android.graphics.PointF srcPoint)
Converts the screen coordinates of a point to page coordinates.
|
android.graphics.RectF |
convertRectFromPage(boolean isCropMode,
float showWidth,
float showHeight,
android.graphics.RectF srcRect)
Converts page coordinates to the screen coordinates of a point.
|
android.graphics.RectF |
convertRectFromPage(android.graphics.RectF srcRect,
android.graphics.Matrix invertMatrix) |
android.graphics.RectF |
convertRectToPage(boolean isCropMode,
float showWidth,
float showHeight,
android.graphics.RectF srcRect)
Converts the screen coordinates of a point to page coordinates.
|
boolean |
deleteAnnotation(CPDFAnnotation annotation)
Removes the specified annotation from the page.
|
void |
endEdit()
Exit text editing mode and release resources.
|
boolean |
extractImages(java.lang.String filePath)
Exports all the images on the page.
|
boolean |
flatten(CPDFPage.PDFFlattenOption flattenOption)
Flatten annotations and form fields into the page contents.
|
java.util.List<CPDFAnnotation> |
getAnnotations() |
java.util.List<CPDFAnnotation> |
getAnnotationsRecreate() |
int |
getAnnotCount()
Gets the count of annotations on the page.
|
android.graphics.RectF |
getBounds()
not in use currently
|
android.graphics.RectF |
getBoundsForBox(CPDFPage.PDFDisplayBox displayBox)
not in use currently
|
android.graphics.RectF |
getCropBounds()
Gets crop rectangle.
|
void |
getDisplayMatrix(android.graphics.Matrix matrixInstance,
boolean isCropMode,
float ox,
float oy,
float width,
float height,
int rotation) |
CPDFEditPage |
getEditPage(boolean isNative) |
int |
getPageNum() |
long |
getPagePtr()
Get the page pointer in the native layer.
|
int |
getRotation()
Gets the rotation angle for the page in degrees.
|
android.graphics.RectF |
getSize()
Gets page size, the width is
RectF.width() , the height isRectF.height() |
CPDFTextPage |
getTextPage()
Gets TextPage, this class is for text related functions, more:
CPDFTextPage |
boolean |
isImagePage()
Whether the page is image page.
|
boolean |
isValid()
Whether object is valid.
|
void |
refreshTextPage()
Reload a new CPDFTextPage.
|
void |
releaseAllAnnotations()
Releases all annotation resources on the page.
|
boolean |
removeAllAnnotations()
Removes all the annotations from the page.
|
boolean |
removeAllFormAnnotations()
Removes all the form widgets from the page.
|
boolean |
removeAllSign()
Removes all signatures on the page.
|
boolean |
removeAllSignStamps()
Removes all signatures and stamps on the page.
|
boolean |
renderPage(android.graphics.Bitmap bitmap,
float scale,
int width,
int height,
int startX,
int startY,
int drawSizeHor,
int drawSizeVer,
int bgColor,
int bgColor_a,
int rotate,
boolean drawAnnot,
boolean drawForm)
Render contents of a page to a device independent bitmap.
|
boolean |
renderPage(android.graphics.Bitmap bitmap,
int startX,
int startY,
int drawSizeHor,
int drawSizeVer,
int bgColor,
int bgColor_a,
int rotate,
boolean drawAnnot,
boolean drawForm)
Render contents of a page to a device independent bitmap.
|
boolean |
renderPageByPixel(android.graphics.Bitmap bitmap,
float scale,
int width,
int height,
int startX,
int startY,
int drawSizeHor,
int drawSizeVer,
int bgColor,
int bgColor_a,
int rotate,
boolean drawAnnot,
boolean drawForm)
Render contents of a page to a device independent bitmap.
|
boolean |
resetAllForm()
Resets all forms on the page.
|
boolean |
setBoundsForBox(CPDFPage.PDFDisplayBox displayBox,
android.graphics.RectF bounds)
not in use currently
|
boolean |
setRotation(int rotation)
Sets the rotation angle for the page in degrees.
|
java.util.List<CPDFAnnotation> |
updateHighlightAnnotations() |
public int getPageNum()
public boolean isValid()
public long getPagePtr()
public android.graphics.RectF getBoundsForBox(CPDFPage.PDFDisplayBox displayBox)
public boolean setBoundsForBox(CPDFPage.PDFDisplayBox displayBox, android.graphics.RectF bounds)
public android.graphics.RectF getCropBounds()
public android.graphics.RectF getBounds()
public android.graphics.RectF getSize()
RectF.width()
, the height isRectF.height()
public int getRotation()
CPDFAnnotation.getApRotation()
public boolean setRotation(int rotation)
rotation
- Rotation on a page. Must be 0, 90, 180 or 270.public android.graphics.PointF convertPointToPage(boolean isCropMode, float showWidth, float showHeight, android.graphics.PointF srcPoint)
isCropMode
- Whether it is crop mode.showWidth
- Width of the display area in device coordinates.showHeight
- Height of the display area in device coordinates.srcPoint
- The coordinates of the device coordinate system to be converted.public android.graphics.PointF convertPointFromPage(boolean isCropMode, float showWidth, float showHeight, android.graphics.PointF srcPoint)
isCropMode
- Whether it is crop mode.showWidth
- Width of the display area in device coordinates.showHeight
- Height of the display area in device coordinates.srcPoint
- The coordinates of the PDF page to be converted.public android.graphics.RectF convertRectToPage(boolean isCropMode, float showWidth, float showHeight, android.graphics.RectF srcRect)
isCropMode
- Whether it is crop mode.showWidth
- Width of the display area in device coordinates.showHeight
- Height of the display area in device coordinates.srcRect
- The coordinates of the device coordinate system to be converted.public android.graphics.RectF convertRectFromPage(boolean isCropMode, float showWidth, float showHeight, android.graphics.RectF srcRect)
isCropMode
- Whether it is crop mode.showWidth
- Width of the display area in device coordinates.showHeight
- Height of the display area in device coordinates.srcRect
- The coordinates of the device coordinate system to be converted.public void getDisplayMatrix(android.graphics.Matrix matrixInstance, boolean isCropMode, float ox, float oy, float width, float height, int rotation)
public android.graphics.RectF convertRectFromPage(android.graphics.RectF srcRect, android.graphics.Matrix invertMatrix)
public boolean renderPage(android.graphics.Bitmap bitmap, int startX, int startY, int drawSizeHor, int drawSizeVer, int bgColor, int bgColor_a, int rotate, boolean drawAnnot, boolean drawForm)
bitmap
- Handle to the device independent bitmap (as the output buffer).startX
- Left pixel position of the display area in bitmap coordinates.startY
- Top pixel position of the display area in bitmap coordinates.drawSizeHor
- Horizontal size (in pixels) for displaying the page.drawSizeVer
- Vertical size (in pixels) for displaying the page.bgColor
- Background color of the image.bgColor_a
- Background opacity of the image.rotate
- Rotation angle.drawAnnot
- Whether to draw annotation.drawForm
- Whether to draw forms.public boolean renderPage(android.graphics.Bitmap bitmap, float scale, int width, int height, int startX, int startY, int drawSizeHor, int drawSizeVer, int bgColor, int bgColor_a, int rotate, boolean drawAnnot, boolean drawForm)
bitmap
- Handle to the device independent bitmap (as the output buffer).scale
- Scale coefficient.width
- Width of the page.height
- Height of the page.startX
- Left pixel position of the display area in bitmap coordinates.startY
- Top pixel position of the display area in bitmap coordinates.drawSizeHor
- Horizontal size (in pixels) for displaying the page.drawSizeVer
- Vertical size (in pixels) for displaying the page.bgColor
- Background color of the image.bgColor_a
- Background opacity of the image.rotate
- Rotation angle.drawAnnot
- Whether to draw annotation.drawForm
- Whether to draw forms.public boolean renderPageByPixel(android.graphics.Bitmap bitmap, float scale, int width, int height, int startX, int startY, int drawSizeHor, int drawSizeVer, int bgColor, int bgColor_a, int rotate, boolean drawAnnot, boolean drawForm)
bitmap
- Handle to the device independent bitmap (as the output buffer).scale
- Scale coefficient.width
- Width of the page.height
- Height of the page.startX
- Left pixel position of the display area in bitmap coordinates.startY
- Top pixel position of the display area in bitmap coordinates.drawSizeHor
- Horizontal size (in pixels) for displaying the page.drawSizeVer
- Vertical size (in pixels) for displaying the page.bgColor
- Background color of the image.bgColor_a
- Background opacity of the image.rotate
- Rotation angle.drawAnnot
- Whether to draw annotation.drawForm
- Whether to draw forms.public boolean extractImages(java.lang.String filePath)
filePath
- Exports image to specified path.public boolean flatten(CPDFPage.PDFFlattenOption flattenOption)
flattenOption
- One of the flattenOption values denoting the page usage, more CPDFPage.PDFFlattenOption
public int getAnnotCount()
public java.util.List<CPDFAnnotation> getAnnotations()
public java.util.List<CPDFAnnotation> updateHighlightAnnotations()
public java.util.List<CPDFAnnotation> getAnnotationsRecreate()
public void addAnnot(CPDFAnnotation annotation)
public boolean deleteAnnotation(CPDFAnnotation annotation)
annotation
- The specified annotation to be removedpublic CPDFAnnotation addAnnot(CPDFAnnotation.Type type)
CPDFAnnotation.Type
type
- The type of annotation to be added, more: CPDFAnnotation.Type
public CPDFWidget addFormWidget(CPDFWidget.WidgetType type)
CPDFAnnotation.Type
type
- Type of form widgets, more: CPDFAnnotation.Type
public boolean removeAllAnnotations()
public boolean removeAllFormAnnotations()
public boolean removeAllSignStamps()
public boolean resetAllForm()
public CPDFTextPage getTextPage()
CPDFTextPage
CPDFTextPage
public boolean removeAllSign()
public void close()
public void endEdit()
public void releaseAllAnnotations()
public boolean applyRedactions()
public CPDFEditPage getEditPage(boolean isNative)
public void refreshTextPage()
public boolean isImagePage()