java.lang.Object | |
↳ | com.pdftron.pdf.utils.AnnotUtils |
A utility class for handling annotation.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
interface | AnnotUtils.AnnotVisitor | Visitor that visits annotations on a single page or in an entire document. | |||||||||
interface | AnnotUtils.AnnotWithPageVisitor | Visitor that visits annotations on a single page or in an entire document. | |||||||||
interface | AnnotUtils.PageVisitor | Visitor that visits pages within a document. |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | KEY_INK_LIST | ||||||||||
String | XFDF_ADD | ||||||||||
String | XFDF_DELETE | ||||||||||
String | XFDF_MODIFY |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
public static String | KEY_ANNOT_ROTATION | ||||||||||
public static String | KEY_FreeTextDate | ||||||||||
public static String | KEY_FreeTextFill | ||||||||||
public static String | KEY_InReplyTo | ||||||||||
public static String | KEY_NM | ||||||||||
public static String | KEY_RawRichContent | ||||||||||
public static String | KEY_ReplyTo | ||||||||||
public static String | KEY_RichContent | ||||||||||
public static String | KEY_UNROTATED_BBOX | ||||||||||
public static String | KEY_WidgetAuthor | ||||||||||
public static String | Key_State | ||||||||||
public static String | Key_StateAccepted | ||||||||||
public static String | Key_StateCancelled | ||||||||||
public static String | Key_StateCompleted | ||||||||||
public static String | Key_StateModel | ||||||||||
public static String | Key_StateModelMarked | ||||||||||
public static String | Key_StateModelReview | ||||||||||
public static String | Key_StateNone | ||||||||||
public static String | Key_StateRejected | ||||||||||
public static String | VALUE_Group | ||||||||||
public static double | sMinBitmapAppearanceDPI |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AnnotUtils() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static void |
applyCustomFreeTextAppearance(PDFViewCtrl pdfViewCtrl, AutoScrollEditText editText, Annot annot, int pageNum)
Applies custom appearance for a FreeText with custom spacing annotation.
| ||||||||||
static void | applyRedaction(PDFViewCtrl pdfViewCtrl, Redaction redactAnnot, ArrayList<Redactor.Redaction> arr) | ||||||||||
static boolean |
canSetDateToNow(PDFViewCtrl pdfViewCtrl, Annot annot)
A read lock is required around this method
| ||||||||||
static boolean |
canUseBitmapAppearance(Annot annot)
A read lock is expected around this method.
| ||||||||||
static int | compareCreationDate(Annot thisObj, Annot thatObj) | ||||||||||
static int | compareDate(Annot thisObj, Annot thatObj) | ||||||||||
static Rect |
computeAnnotInbox(PDFViewCtrl pdfViewCtrl, Annot annot, int pg)
Returns the bounding box of the specified annotation in screen space.
| ||||||||||
static void |
createAnnotationGroup(PDFViewCtrl pdfViewCtrl, Annot primary, ArrayList<Annot> allInGroup)
Creates a group of annotations
| ||||||||||
static Annot | createAnnotationReply(String parentAnnotId, int pageNum, PDFViewCtrl pdfViewCtrl, String authorId, String contents) | ||||||||||
static Annot | createAnnotationStateReply(String parentAnnotId, int pageNum, PDFViewCtrl pdfViewCtrl, String authorId, String authorName, AnnotReviewState state) | ||||||||||
static void | createCustomFreeTextAppearance(View view, PDFViewCtrl pdfViewCtrl, Annot annot, int pageNum, Rect bbox, boolean useBBoxLocation, AnnotStyle annotStyle) | ||||||||||
static void |
createCustomFreeTextAppearance(View view, PDFViewCtrl pdfViewCtrl, Annot annot, int pageNum, Rect bbox)
Applies custom appearance for a FreeText annotation
that is generated from Android EditText
Note 1: This API only takes effect on KitKit and above
Note 2: A write lock is expected around this call
| ||||||||||
static void |
createCustomFreeTextAppearance(View view, PDFViewCtrl pdfViewCtrl, Annot annot, int pageNum, Rect bbox, boolean useBBoxLocation)
Applies custom appearance for a FreeText annotation
that is generated from Android EditText
Note 1: This API only takes effect on KitKit and above
Note 2: A write lock is expected around this call
| ||||||||||
static File |
createPdfFromView(View content, int width, int height, File outputFile)
Attempts to create a new single page PDF document using the appearance from an Android view.
| ||||||||||
static void |
createRCFreeTextAppearance(PTRichEditor richEditor, PDFViewCtrl pdfViewCtrl, Annot annot, int pageNum, AnnotStyle annotStyle)
Creates the FreeText appearance from
PTRichEditor
This method does not lock document, a write lock should be acquired outside
| ||||||||||
static String |
createScreenshot(File tempDir, PDFDoc pdfDoc, Annot annot, int pageNum)
Static function to create a screenshot out of the bounds of an annot rect bbox.
| ||||||||||
static
|
createScreenshotAsync(File tempDir, PDFDoc pdfDoc, Annot annot, int annotPageNumber)
Asyncronous method for creating screenshots, as some complex files might take some time to render.
| ||||||||||
static void | createSoundAnnotation(PDFViewCtrl pdfViewCtrl, PointF targetPagePoint, int pageNum, String outputFile) | ||||||||||
static void | deleteAllAnnotsByType(PDFDoc doc, int type) | ||||||||||
static void | deleteAnnotationReply(String replyId, int pageNum, PDFViewCtrl pdfViewCtrl, ToolManager toolManager) | ||||||||||
static Rect | deserializeRect(String rectStr) | ||||||||||
static Annot |
flattenAnnot(PDFViewCtrl pdfViewCtrl, Annot annot, int pageNum)
Flattens an annotation.
| ||||||||||
static Rect | getActualUnrotatedBBox(PDFViewCtrl pdfViewCtrl, Annot annot, int pageNum) | ||||||||||
static ArrayList<Pair<Redaction, Integer>> | getAllRedactions(PDFViewCtrl pdfViewCtrl) | ||||||||||
static int |
getAnnotBaseRotation(PDFViewCtrl pdfViewCtrl, int pageNumber)
Viewer and page rotation
| ||||||||||
static int |
getAnnotColor(Annot annot)
Returns the annotation color of the specified annotation.
| ||||||||||
static String | getAnnotContents(PDFDoc pdfDoc, Annot annot) | ||||||||||
static int |
getAnnotImageResId(int type)
Returns the annotation image resource ID.
| ||||||||||
static Date |
getAnnotLocalCreationDate(Annot annot)
Gets the annotation creation date in local date time
| ||||||||||
static Date |
getAnnotLocalDate(Annot annot)
Gets the annotation date in local date time
| ||||||||||
static float |
getAnnotOpacity(Annot annot)
Returns the annotation opacity of the specified annotation.
| ||||||||||
static int |
getAnnotRotation(Annot annot)
A read lock is needed around this method.
| ||||||||||
static int |
getAnnotRotationRelToPage(PDFViewCtrl pdfViewCtrl, Annot annot, int pageNumber)
Annotation rotation reletive to page and viewer rotation
| ||||||||||
static AnnotStyle |
getAnnotStyle(Annot annot)
Gets the annot style
A read lock is required for this function.
| ||||||||||
static int | getAnnotType(Annot annot) | ||||||||||
static String |
getAnnotTypeAsPluralString(Annot annot)
Returns annotation type as raw plural string (not localized).
| ||||||||||
static String |
getAnnotTypeAsPluralString(Context context, Annot annot)
Returns annotation type as string.
| ||||||||||
static String |
getAnnotTypeAsString(Annot annot)
Returns annotation type as raw string (not localized).
| ||||||||||
static String |
getAnnotTypeAsString(Context context, int typeId)
Returns annotation type as string.
| ||||||||||
static String |
getAnnotTypeAsString(Context context, Annot annot)
Returns annotation type as string.
| ||||||||||
static int |
getAnnotUIRotation(PDFViewCtrl pdfViewCtrl, Annot annot, int pageNumber)
Gets annotation rotation used in UI, read lock is not required.
| ||||||||||
static Bitmap | getAnnotationAppearance(PDFViewCtrl pdfViewCtrl, Annot annot) | ||||||||||
static
|
getAnnotationAppearanceAsync(PDFViewCtrl pdfViewCtrl, Annot annot) | ||||||||||
static int |
getAnnotationCountOnPage(PDFViewCtrl pdfViewCtrl, int pageNum, ArrayList<Integer> excludeType)
Gets annotation count on page excluding certain types
A read lock should be acquired outside of this method
| ||||||||||
static ArrayList<Annot> |
getAnnotationsInGroup(PDFViewCtrl pdfViewCtrl, Annot annot, int pageNum)
Returns all annotations in this group if the annotation passed in is in an annotation group
| ||||||||||
static Annot |
getAssociatedAnnotation(PDFViewCtrl pdfViewCtrl, SignatureWidget signatureWidget, int pageNum)
Checks if the signature widget overlaps with a signature annotation within a certain distance
Used to check if any annotations should be linked to the widget
| ||||||||||
static String |
getAuthor(Annot annot)
Gets the author for the specified annotation.
| ||||||||||
static String | getCurrentTime(String format) | ||||||||||
static FileAttachment | getFileAttachment(PDFViewCtrl pdfViewCtrl, Annot annot) | ||||||||||
static double | getFormFieldBackgroundOpacity(Annot annot) | ||||||||||
static String |
getIRTAsString(Annot annot)
Gets the unique Id of the IRT parent annotation of this annotation
| ||||||||||
static LineEndingStyle | getLineEndingStyle(Line line, boolean lineStart) | ||||||||||
static Date |
getLocalDate(Date date)
Converts a com.pdftron.pdf.Date to local Date object
| ||||||||||
static Rect | getOldAnnotScreenPosition(PDFViewCtrl pdfViewCtrl, Annot annot, int annotPageNum) | ||||||||||
static Rect | getPageRectFromScreenRect(PDFViewCtrl pdfViewCtrl, Rect screenRect, int pg) | ||||||||||
static Rect | getPageRectFromScreenRect(PDFViewCtrl pdfViewCtrl, Rect screenRect, int pg, int rotation) | ||||||||||
static ArrayList<Point> |
getPolyVertices(Annot annot)
Gets the vertices of a Polyline or a Polygon.
| ||||||||||
static Annot | getPrimaryAnnotInGroup(PDFViewCtrl pdfViewCtrl, ArrayList<Annot> annots) | ||||||||||
static ArrayList<Redactor.Redaction> | getRedactionArray(Redaction redactAnnot, int annotPageNum) | ||||||||||
static RectF | getScreenRectFromPageRect(PDFViewCtrl pdfViewCtrl, Rect pageRect, int pg) | ||||||||||
static int |
getStampDegree(Annot annot)
Gets the rotation degree from Stamp annotation.
| ||||||||||
static int |
getStampDegreeOld(Annot annot)
Gets the deprecated rotation degree from Stamp annotation.
| ||||||||||
static double[] |
getStampSize(Context context, String stampName)
Gets the page corresponding to a certain stamp in our stamps repository.
| ||||||||||
static Bitmap | getStandardStampBitmapFromPdf(Context context, String stampLabel, int bgColor, int height) | ||||||||||
static String | getStandardStampImageFileFromName(Context context, StandardStampPreviewAppearance stampPreviewAppearance, int height) | ||||||||||
static Rect |
getUnrotatedBBox(Annot annot)
A read lock is required.
| ||||||||||
static boolean | hasPermission(PDFDoc pdfDoc, ToolManager toolManager, Annot annot, int kind) | ||||||||||
static boolean |
hasPermission(PDFViewCtrl pdfViewCtrl, Annot annot, int kind)
Checks whether the annotation has the specified permission
| ||||||||||
static boolean | hasPermission(PDFViewCtrl pdfViewCtrl, PDFDoc pdfDoc, ToolManager tm, Annot annot, int kind) | ||||||||||
static boolean |
hasReplyTypeGroup(Annot annot)
Checks if the annotation is part of a group annotation
| ||||||||||
static boolean |
hasReplyTypeReply(Annot annot)
Checks if the annotation is an annotation reply
| ||||||||||
static boolean |
hasRotation(Annot annot)
Gets whether the annotation rotation is not a multiple of 90
A read lock is needed around this method.
| ||||||||||
static boolean |
hasRotation(PDFViewCtrl pdfViewCtrl, Annot annot)
Gets whether the annotation rotation is not a multiple of 90
| ||||||||||
static Boolean | hasUnrotatedBBox(Annot annot) | ||||||||||
static boolean |
isAreaMeasure(Annot annot)
Checks if the annotation is area measurement
This could return a polygon area or a rectangular area measure
A read lock is expected around this method.
| ||||||||||
static boolean |
isArrow(Annot annot)
Checks if the annotation is an arrow
A read lock is expected around this method.
| ||||||||||
static boolean |
isBasicFreeText(Annot annot)
Checks if the annotation is a freetext, but not callout
A read lock is expected around this method.
| ||||||||||
static boolean |
isCallout(Annot annot)
Checks if the annotation is a callout
A read lock is expected around this method.
| ||||||||||
static boolean |
isCloud(Annot annot)
Checks if the annotation is a cloud polygon
A read lock is expected around this method.
| ||||||||||
static boolean |
isCountMeasurement(Annot annot)
Checks if the annotation is measure count tool
A read lock is expected around this method.
| ||||||||||
static boolean |
isFreeHighlighter(Annot annot)
Checks if the annotation is a free highlighter
A read lock is expected around this method.
| ||||||||||
static boolean |
isFreeTextDate(Annot annot)
Checks if the annotation is a date text
A read lock is expected around this method.
| ||||||||||
static boolean |
isFreeTextSpacing(Annot annot)
Checks if the annotation is a fill and sign type free text
A read lock is expected around this method.
| ||||||||||
static boolean |
isGroupSelected(PDFViewCtrl pdfViewCtrl, ArrayList<Annot> selected, int page)
Check whether the selected annotations match an existing group
| ||||||||||
static boolean |
isImageStamp(Annot annot)
Checks if the annotation is an image stamp
A read lock is expected around this method.
| ||||||||||
static boolean |
isListBox(Annot annot)
Checks if the annotation is a list box widget
A read lock is expected around this method.
| ||||||||||
static boolean |
isPerimeterMeasure(Annot annot)
Checks if the annotation is perimeter measurement
A read lock is expected around this method.
| ||||||||||
static boolean |
isRectAreaMeasure(Annot annot)
Checks if the annotation is rectangular area measurement
A read lock is expected around this method.
| ||||||||||
static boolean |
isRuler(Annot annot)
Checks if the annotation is an ruler
A read lock is expected around this method.
| ||||||||||
static boolean |
isSignature(Annot annot)
Checks if the annotation is a signature stamp
A read lock is expected around this method.
| ||||||||||
static boolean |
isSignatureField(Annot annot)
Checks if annot is a SignatureField Widget
A read lock is expected around this method.
| ||||||||||
static boolean |
isSimpleLine(Annot annot)
Checks if the annotation is a line with no ending styles
A read lock is expected around this method.
| ||||||||||
static boolean |
isTextField(Annot annot)
Checks if annot is a TextField Widget
A read lock is expected around this method.
| ||||||||||
static
|
loadSystemFonts() | ||||||||||
static void |
putFreeTextRotationDegree(Annot annot, int rotation)
Sets the rotation degree for FreeText annotation.
| ||||||||||
static void |
putStampDegree(Annot annot, int rotation)
Sets the rotation degree from Stamp annotation.
| ||||||||||
static Rect | quadToRect(QuadPoint qp) | ||||||||||
static void |
refreshAnnotAppearance(Context context, Annot annot)
helper function to refresh annotation appearance.
| ||||||||||
static boolean | refreshCustomFreeTextAppearance(File appearance, Annot annot) | ||||||||||
static void |
safeDeleteAllAnnots(PDFDoc doc)
Delete all annotations except for links and form fields
This method does not lock document, a write lock should be acquired outside
| ||||||||||
static Annot |
safeDeleteAnnot(PDFDoc pdfDoc, Page page, Annot annot)
Used in replacement of
annotRemove(Annot) to handle direct object
The returned Annot object should be used after this function. | ||||||||||
static Annot |
safeDeleteAnnotAndUpdate(PDFViewCtrl pdfViewCtrl, Page page, Annot annot, int annotPageNum)
Used in replacement of
annotRemove(Annot) to handle direct object and updates the viewer
The returned Annot object should be used after this function. | ||||||||||
static void |
safeDeleteAnnotsOnPage(PDFDoc doc, ArrayList<Integer> pages)
Delete all annotations except for links and form fields on pages
This method does not lock document, a write lock should be acquired outside
| ||||||||||
static void |
saveFreeTextCache(FreeTextCacheStruct freeTextCacheStruct, PDFViewCtrl pdfViewCtrl)
Saves the free text in cache.
| ||||||||||
static void |
saveUnrotatedBBox(PDFViewCtrl pdfViewCtrl, Annot annot, int pageNum)
A write lock is required.
| ||||||||||
static String | serializeRect(Rect rect) | ||||||||||
static void | setAnnotContents(PDFDoc pdfDoc, Markup markup, String newContent) | ||||||||||
static void |
setAuthor(Markup markup, String author)
Sets the author for the specified markup annotation.
| ||||||||||
static void |
setAuthor(Annot annot, String author)
Sets the author for the specified annotation, if possible.
| ||||||||||
static void |
setBorderStyle(Annot annot, int effect, int style, double[] dash)
A write lock is expected around this call
| ||||||||||
static void | setDateToNow(PDFViewCtrl pdfViewCtrl, Annot annot) | ||||||||||
static void | setLineEndingStyle(Line line, LineEndingStyle lineEndingStyle, Boolean lineStart) | ||||||||||
static void |
setStyle(Annot annot, boolean hasFill, int strokeColor, int fillColor, float thickness, float opacity)
A write lock is expected around this call
| ||||||||||
static void |
setUniqueId(Annot annot, String id)
Sets the unique identifier for the specified annotation, if possible.
| ||||||||||
static JSONObject | simpleXmlParser(String xfdfCommand) | ||||||||||
static void |
traverseAnnots(Page page, AnnotUtils.AnnotVisitor visitor)
Traverse over all annotations on the specified page.
| ||||||||||
static void |
traverseAnnots(PDFDoc doc, AnnotUtils.AnnotVisitor visitor)
Traverse over all annotations in the specified document.
| ||||||||||
static void |
traverseAnnotsWithPage(PDFDoc doc, AnnotUtils.AnnotWithPageVisitor visitor)
Traverse over all annotations in the specified document.
| ||||||||||
static void |
traverseAnnotsWithPage(Page page, AnnotUtils.AnnotWithPageVisitor visitor)
Traverse over all annotations on the specified page.
| ||||||||||
static void |
traversePages(PDFDoc doc, AnnotUtils.PageVisitor visitor)
Traverse over all pages in the specified document.
| ||||||||||
static void | ungroupAnnotations(PDFViewCtrl pdfViewCtrl, ArrayList<Annot> allInGroup) | ||||||||||
static boolean |
updateAnnotOnMoveToNewPage(PDFViewCtrl pdfViewCtrl, Annot annot, int currentPageNum, int newPageNum, RectF currentAnnotScreenRect, RectF newAnnotScreenRect, boolean customTextFieldAppearance)
Updates the annotation based on the new page and new screen Rect, so that the appearance
will look right side up from the user's perspective.
| ||||||||||
static Annot | updateAnnotationReply(String replyId, int pageNum, PDFViewCtrl pdfViewCtrl, ToolManager toolManager, String contents) | ||||||||||
static void |
updateContentRectOnMove(PDFViewCtrl pdfViewCtrl, Annot annot, int currentPageNum, int newPageNum, RectF currentAnnotScreenRect, RectF newAnnotScreenRect)
Updates the Rect and content Rect of the annotation when the annotation is moved.
| ||||||||||
static String |
xfdfCommandExtract(PDFDoc pdfDoc, List<String> annotIdsAdded, List<String> annotIdsModified, List<String> annotIdsDeleted)
Returns an XFDF command with add, modify, and delete tags containing annotations associated
with the given annotation ids and PDFDoc.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Applies custom appearance for a FreeText with custom spacing annotation. Note: appearance will only be applied for Android Lollipop and above. A write lock is expected around this call
pdfViewCtrl | the viewer |
---|---|
editText | the EditText where appearance is from |
annot | the annotation to apply the appearance to |
pageNum | the page number of the annot |
PDFNetException |
---|
PDFNetException |
---|
A read lock is required around this method
PDFNetException |
---|
A read lock is expected around this method.
PDFNetException |
---|
Returns the bounding box of the specified annotation in screen space.
pdfViewCtrl | The PDFViewCtrl |
---|---|
annot | The annotation |
pg | The page number |
Creates a group of annotations
primary | the primary annotation |
---|---|
allInGroup | all annotations to be added to this group |
PDFNetException |
---|
PDFNetException |
---|
PDFNetException |
---|
PDFNetException |
---|
Applies custom appearance for a FreeText annotation that is generated from Android EditText Note 1: This API only takes effect on KitKit and above Note 2: A write lock is expected around this call
view | the EditText where appearance is from |
---|---|
pdfViewCtrl | the viewer |
annot | the annotation to apply the appearance to |
pageNum | the page number of the annot |
bbox | when a bbox is supplied, this will be used as bbox of the annotation |
PDFNetException |
---|
Applies custom appearance for a FreeText annotation that is generated from Android EditText Note 1: This API only takes effect on KitKit and above Note 2: A write lock is expected around this call
view | the EditText where appearance is from |
---|---|
pdfViewCtrl | the viewer |
annot | the annotation to apply the appearance to |
pageNum | the page number of the annot |
bbox | when a bbox is supplied, this will be used as bbox of the annotation |
useBBoxLocation | when true, the bbox location will be used as the bbox of the annotation, otherwise, only width/height will be used |
PDFNetException |
---|
Attempts to create a new single page PDF document using the appearance from an Android view. Returns the output file if successfully created. If a file already exists, it will get overwritten.
content | view used to create a PDF document |
---|---|
width | width of the document |
height | height of the document |
outputFile | output PDF file to write to, this file will be overwritten. |
Creates the FreeText appearance from PTRichEditor
This method does not lock document, a write lock should be acquired outside
PDFNetException |
---|
Static function to create a screenshot out of the bounds of an annot rect bbox. Note that this requires a read lock on the PDFDoc.
tempDir | temporary directory to store the created PNG file |
---|---|
pdfDoc | current PDFDoc |
annot | annot to get the screenshot off of |
pageNum | current page number of the annot |
PDFNetException | any exception thrown. will be handled somewhere else |
---|
Asyncronous method for creating screenshots, as some complex files might take some time to render.
tempDir | temporary directory path |
---|---|
pdfDoc | PDFDoc that contains the annotation |
annot | (square) annot used to create the screenshot with |
annotPageNumber | page number that the annotation is on |
PDFNetException |
---|
Flattens an annotation. A document lock is required around this method.
PDFNetException |
---|
PDFNetException |
---|
PDFNetException |
---|
Viewer and page rotation
Returns the annotation color of the specified annotation.
annot | The annotation |
---|
Returns the annotation image resource ID.
type | The type of annotation |
---|
Gets the annotation creation date in local date time
annot | the annotation |
---|
PDFNetException |
---|
Gets the annotation date in local date time
annot | the annotation |
---|
PDFNetException |
---|
Returns the annotation opacity of the specified annotation.
annot | The annotation |
---|
A read lock is needed around this method.
PDFNetException |
---|
Annotation rotation reletive to page and viewer rotation
Gets the annot style A read lock is required for this function.
annot | the annotation |
---|
PDFNetException | PDFNet exception |
---|
Returns annotation type as raw plural string (not localized).
annot | The annotation |
---|
PDFNetException |
---|
Returns annotation type as string.
context | The context |
---|---|
annot | The annotation |
PDFNetException |
---|
Returns annotation type as raw string (not localized).
annot | The annotation |
---|
PDFNetException |
---|
Returns annotation type as string.
context | The context |
---|---|
typeId | The annotation type ID |
Returns annotation type as string.
context | The context |
---|---|
annot | The annotation |
PDFNetException |
---|
Gets annotation rotation used in UI, read lock is not required.
Gets annotation count on page excluding certain types A read lock should be acquired outside of this method
PDFNetException |
---|
Returns all annotations in this group if the annotation passed in is in an annotation group
PDFNetException |
---|
Checks if the signature widget overlaps with a signature annotation within a certain distance Used to check if any annotations should be linked to the widget
Gets the author for the specified annotation. Annotation needs to be either type of markup or widget.
annot | the annotation |
---|
PDFNetException |
---|
Gets the unique Id of the IRT parent annotation of this annotation
PDFNetException |
---|
PDFNetException |
---|
Converts a com.pdftron.pdf.Date to local Date object
date | to convert |
---|
PDFNetException |
---|
PDFNetException |
---|
PDFNetException |
---|
PDFNetException |
---|
Gets the vertices of a Polyline or a Polygon. This method does not lock the document, so a read lock should be acquired outside.
annot | annotation with type of polyline or polygon |
---|
PDFNetException |
---|
PDFNetException |
---|
PDFNetException |
---|
Gets the rotation degree from Stamp annotation. A read lock is expected around this method.
PDFNetException |
---|
Gets the deprecated rotation degree from Stamp annotation. A read lock is expected around this method.
PDFNetException |
---|
Gets the page corresponding to a certain stamp in our stamps repository.
context | The context |
---|---|
stampName | The name of stamp icon |
Checks whether the annotation has the specified permission
annot | The annotation |
---|---|
kind | The kind of permission. Possible values are
ANNOT_PERMISSION_SELECTION ,
ANNOT_PERMISSION_MENU
ANNOT_PERMISSION_FILL_AND_SIGN
ANNOT_PERMISSION_INTERACT |
Checks if the annotation is part of a group annotation
annot | the annotation |
---|
PDFNetException |
---|
Checks if the annotation is an annotation reply
annot | the annotation |
---|
PDFNetException |
---|
Gets whether the annotation rotation is not a multiple of 90 A read lock is needed around this method.
PDFNetException |
---|
Gets whether the annotation rotation is not a multiple of 90
Checks if the annotation is area measurement This could return a polygon area or a rectangular area measure A read lock is expected around this method.
annot | The annotation |
---|
Checks if the annotation is an arrow A read lock is expected around this method.
annot | The annotation |
---|
PDFNetException | PDFNet exception |
---|
Checks if the annotation is a freetext, but not callout A read lock is expected around this method.
annot | The annotation |
---|
PDFNetException |
---|
Checks if the annotation is a callout A read lock is expected around this method.
annot | The annotation |
---|
PDFNetException |
---|
Checks if the annotation is a cloud polygon A read lock is expected around this method.
annot | The annotation |
---|
PDFNetException | PDFNet exception |
---|
Checks if the annotation is measure count tool A read lock is expected around this method.
annot | The annotation |
---|
Checks if the annotation is a free highlighter A read lock is expected around this method.
annot | The annotation |
---|
PDFNetException | PDFNet exception |
---|
Checks if the annotation is a date text A read lock is expected around this method.
annot | The annotation |
---|
PDFNetException |
---|
Checks if the annotation is a fill and sign type free text A read lock is expected around this method.
annot | The annotation |
---|
PDFNetException |
---|
Check whether the selected annotations match an existing group
selected | the selected annotations |
---|
PDFNetException |
---|
Checks if the annotation is an image stamp A read lock is expected around this method.
annot | The annotation |
---|
PDFNetException |
---|
Checks if the annotation is a list box widget A read lock is expected around this method.
annot | The annotation |
---|
PDFNetException |
---|
Checks if the annotation is perimeter measurement A read lock is expected around this method.
annot | The annotation |
---|
Checks if the annotation is rectangular area measurement A read lock is expected around this method.
annot | The annotation |
---|
Checks if the annotation is an ruler A read lock is expected around this method.
annot | The annotation |
---|
Checks if the annotation is a signature stamp A read lock is expected around this method.
annot | The annotation |
---|
PDFNetException |
---|
Checks if annot is a SignatureField Widget A read lock is expected around this method.
annot | The annotation |
---|
PDFNetException |
---|
Checks if the annotation is a line with no ending styles A read lock is expected around this method.
annot | The annotation |
---|
PDFNetException | PDFNet exception |
---|
Checks if annot is a TextField Widget A read lock is expected around this method.
annot | The annotation |
---|
PDFNetException |
---|
Sets the rotation degree for FreeText annotation. A write lock is expected around this method.
PDFNetException |
---|
Sets the rotation degree from Stamp annotation. A write lock is expected around this method.
PDFNetException |
---|
helper function to refresh annotation appearance. Note that some annotations may have their own custom appearance such as Text annotation.
context | The Context |
---|---|
annot | The annotation |
PDFNetException | PDFNet exception |
---|
Delete all annotations except for links and form fields This method does not lock document, a write lock should be acquired outside
doc | the PDFDoc |
---|
Used in replacement of annotRemove(Annot)
to handle direct object
The returned Annot object should be used after this function.
The Annot parameter should no longer be used after this function.
PDFNetException |
---|
Used in replacement of annotRemove(Annot)
to handle direct object and updates the viewer
The returned Annot object should be used after this function.
The Annot parameter should no longer be used after this function.
PDFNetException |
---|
Delete all annotations except for links and form fields on pages This method does not lock document, a write lock should be acquired outside
doc | the PDFDoc |
---|
Saves the free text in cache.
freeTextCacheStruct | The FreeTextCacheStruct |
---|---|
pdfViewCtrl | The PDFViewCtrl |
A write lock is required.
PDFNetException |
---|
PDFNetException |
---|
Sets the author for the specified markup annotation.
This method does not lock the document, so a write lock should be acquired outside.
markup | the Markup annotation |
---|---|
author | the desired author name |
Sets the author for the specified annotation, if possible.
This method does not lock the document, so a write lock should be acquired outside.
annot | the Annot |
---|---|
author | the desired author name |
A write lock is expected around this call
PDFNetException |
---|
PDFNetException |
---|
A write lock is expected around this call
PDFNetException |
---|
Sets the unique identifier for the specified annotation, if possible.
This method does not lock the document, so a write lock should be acquired outside.
annot | the Annot |
---|---|
id | the unique identifier |
IOException | |
---|---|
JSONException | |
ParserConfigurationException | |
SAXException |
Traverse over all annotations on the specified page. The visitor
will be
called for each annot via visit(Annot)
, allowing for arbitrary operations
to be performed on the annot.
This method does not lock the document, so a read lock should be acquired outside.
page | the Page |
---|---|
visitor | the AnnotUtils.AnnotVisitor to visit each annot
|
Traverse over all annotations in the specified document. The AnnotUtils.AnnotVisitor
will be
called for each annot via visit(Annot)
, allowing for arbitrary operations
to be performed on the annot.
This method does not lock the document, so a read lock should be acquired outside.
doc | the PDFDoc |
---|---|
visitor | the AnnotUtils.AnnotVisitor to visit each annot
|
Traverse over all annotations in the specified document. The AnnotUtils.AnnotWithPageVisitor
will be
called for each annot via visit(Pair)
, allowing for arbitrary operations
to be performed on the annot.
This method does not lock the document, so a read lock should be acquired outside.
doc | the PDFDoc |
---|---|
visitor | the AnnotUtils.AnnotWithPageVisitor to visit each annot
|
Traverse over all annotations on the specified page. The visitor
will be
called for each annot via visit(Pair)
, allowing for arbitrary operations
to be performed on the annot.
This method does not lock the document, so a read lock should be acquired outside.
page | the Page |
---|---|
visitor | the AnnotUtils.AnnotWithPageVisitor to visit each annot
|
Traverse over all pages in the specified document. The visitor
will be
called for each page via visit(Page)
, allowing for arbitrary operations
to be performed on the page.
This method does not lock the document, so a read lock should be acquired outside.
doc | the PDFDoc |
---|---|
visitor | the AnnotUtils.PageVisitor to visit each page
|
PDFNetException |
---|
Updates the annotation based on the new page and new screen Rect, so that the appearance will look right side up from the user's perspective. It will update any data points in the annotation based on the new page according to its rotation if needed (such as Ink Points, Poly points, Line points, etc...).
For Images, Signatures, Stamps, or any annotation with custom appearance, the appearance itself will be rotated if needed. You should not call refreshAppearance afterwards, otherwise the custom appearance will be lost.
A write lock is required around this method.
pdfViewCtrl | the PDFViewCtrl |
---|---|
annot | the annotation of interest |
currentPageNum | the current page of the annotation |
newPageNum | the new page of the annotation that we want to generate appearance |
currentAnnotScreenRect | the current screen rect of the annotation |
newAnnotScreenRect | the new screen rect of the annotation |
PDFNetException |
---|
PDFNetException |
---|
Updates the Rect and content Rect of the annotation when the annotation is moved. This method supports moving between different pages.
A write lock is required around this method.
pdfViewCtrl | the PDFViewCtrl |
---|---|
annot | the annotation of interest |
currentPageNum | the current page of the annotation |
newPageNum | the new page of the annotation that we want to generate appearance |
currentAnnotScreenRect | the current screen rect of the annotation |
newAnnotScreenRect | the new screen rect of the annotation |
PDFNetException |
---|
Returns an XFDF command with add, modify, and delete tags containing annotations associated with the given annotation ids and PDFDoc.
Requires caller to hold a read lock.
pdfDoc | the PDFDoc used to create the XFDF command |
---|---|
annotIdsAdded | the list of annotation ids associated with annotations in the doc that should be included in the add tag |
annotIdsModified | the list of annotation ids associated with annotations in the doc that should be included in the modify tag |
annotIdsDeleted | the list of annotation ids associated with annotations in the doc that should be included in the delete tag |