Package com.itextpdf.forms.fields
Class PdfFormAnnotationUtil
java.lang.Object
com.itextpdf.forms.fields.PdfFormAnnotationUtil
Utility class to work with widget annotations
PdfFormAnnotation and its dictionaries.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddWidgetAnnotationToPage(PdfPage page, PdfAnnotation annotation) Add widget annotation to the specified page.static voidaddWidgetAnnotationToPage(PdfPage page, PdfAnnotation annotation, int index) Add widget annotation to the specified page.static booleanisPureWidget(PdfDictionary fieldDict) Check thatobject is pure widget annotation. static booleanisPureWidgetOrMergedField(PdfDictionary fieldDict) Check thatobject is widget annotation or merged field. static voidMerge single widget annotation with its parent field.static voidSeparate merged field to form field and pure widget annotation.
-
Method Details
-
isPureWidgetOrMergedField
Check thatobject is widget annotation or merged field. - Parameters:
-
fieldDict- field dictionary to check. - Returns:
- true if passed dictionary is a widget or merged field, false otherwise.
-
isPureWidget
Check thatobject is pure widget annotation. - Parameters:
-
fieldDict- field dictionary to check. - Returns:
- true if passed dictionary is a widget, false otherwise.
-
addWidgetAnnotationToPage
Add widget annotation to the specified page.- Parameters:
-
page- to which annotation should be added. -
annotation- widget annotation to add.
-
addWidgetAnnotationToPage
Add widget annotation to the specified page.- Parameters:
-
page- to which annotation should be added. -
annotation- widget annotation to add. -
index- the index at which specified annotation will be added. If-1then annotation will be added to the end of an array.
-
mergeWidgetWithParentField
Merge single widget annotation with its parent field.- Parameters:
-
field- parent field.
-
separateWidgetAndField
Separate merged field to form field and pure widget annotation. Do nothing if the incoming field is not merged field.- Parameters:
-
field- to separate.
-