Package com.compdfkit.core.page
Class CPDFPage
java.lang.Object
com.compdfkit.core.page.CPDFPage
TPDFPage defines methods used to render PDF pages and work with annotations, text, selections and so on.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionaddAnnot(CPDFAnnotation.Type type, CPDFDocument document) Adds annotations on page according to the type of annotation, more:CPDFAnnotation.TypeaddFormWidget(CPDFWidget.WidgetType type, CPDFDocument document) Adds a form widget on the page according to the type of form widgets.booleanApplies redaction annotations in current page.voidclose()When the object is no longer in use, call this method to release resources.booleandeleteAnnotation(CPDFAnnotation annotation) Removes the specified annotation from the page.booleanextractImages(String filePath) Exports all the images on the page.booleanflatten(CPDFPage.PDFFlattenOption flattenOption) Flatten annotations and form fields into the page contents.Gets all the annotation collections on the page.intGets the count of annotations on the page.not in use currentlyintlongGet the page pointer in the native layer.intGets the rotation angle for the page in degrees.getSize()Gets page size, the width iscandroid.graphics.RectF#width(), the height isandroid.graphics.RectF#height()booleanisValid()Whether object is valid.voidReleases all annotation resources on the page.booleanRemove untagged watermark.voidsetPageNum(int pageNum) booleansetRotation(int rotation) Sets the rotation angle for the page in degrees.booleanUpdate AP of all forms on the page.
-
Field Details
-
lockObj
-
-
Method Details
-
getPageNum
public int getPageNum() -
setPageNum
public void setPageNum(int pageNum) -
getBounds
not in use currently -
getSize
Gets page size, the width iscandroid.graphics.RectF#width(), the height isandroid.graphics.RectF#height()- Returns:
- Returns page size.
-
getRotation
public int getRotation()Gets the rotation angle for the page in degrees.- Returns:
- Returns the rotation angle for the page in degrees.
-
setRotation
public boolean setRotation(int rotation) Sets the rotation angle for the page in degrees.- Parameters:
rotation- Rotation on a page. Must be 0, 90, 180 or 270.- Returns:
- Whether to successfully set the rotation angle for the page in degrees.
-
flatten
Flatten annotations and form fields into the page contents.- Parameters:
flattenOption- One of the flattenOption values denoting the page usage, moreCPDFPage.PDFFlattenOption- Returns:
- Returns whether to successfully flatten.
-
getAnnotCount
public int getAnnotCount()Gets the count of annotations on the page.- Returns:
- Returns the count of annotations on the page.
-
getAnnotations
Gets all the annotation collections on the page.- Returns:
- Returns all the annotation collections on the page.
-
updateFormAp
public boolean updateFormAp()Update AP of all forms on the page.- Returns:
- Whether to successfully Update AP.
-
deleteAnnotation
Removes the specified annotation from the page.- Parameters:
annotation- The specified annotation to be removed- Returns:
- Returns whether to successfully remove the specified annotation from the page.
-
addAnnot
Adds annotations on page according to the type of annotation, more:CPDFAnnotation.Type- Parameters:
type- The type of annotation to be added, more:CPDFAnnotation.Typedocument- This class is about CPDFDocument, one CPDFDocument class for one document.- Returns:
- Returns the added annotations object.
-
applyRedactions
public boolean applyRedactions()Applies redaction annotations in current page.- Returns:
- Returns whether to successfully apply redaction in current page.
-
extractImages
Exports all the images on the page.- Parameters:
filePath- Exports image to specified path.- Returns:
- Returns whether to successfully export all the images.
-
addFormWidget
Adds a form widget on the page according to the type of form widgets. , more:CPDFAnnotation.Type- Parameters:
type- Type of form widgets, more:CPDFAnnotation.Typedocument- This class is about CPDFDocument, one CPDFDocument class for one document.- Returns:
- Returns the added form widgets object.
-
getPagePtr
public long getPagePtr()Get the page pointer in the native layer.- Returns:
- page pointer
-
isValid
public boolean isValid()Whether object is valid.- Returns:
- Returns whether object is valid.
-
releaseAllAnnotations
public void releaseAllAnnotations()Releases all annotation resources on the page. -
removeUntaggedWatermark
public boolean removeUntaggedWatermark()Remove untagged watermark.- Returns:
- Returns whether to successfully remove untagged watermark.
-
close
public void close()When the object is no longer in use, call this method to release resources.
-