Package com.datalogics.PDFL
Class InkAnnotation
java.lang.Object
com.datalogics.PDFL.Annotation
com.datalogics.PDFL.InkAnnotation
A type of annotation allowing a user to edit a PDF document. Ink annotations in a PDF file allow a user to work with a PDF document displayed on a screen just as if it were on paper, such as scribbling notes in the margins, or circling or underlining text. These types of annotations require a stylus or pen used on a tablet device.
-
Constructor Summary
ConstructorsConstructorDescriptionInkAnnotation(Page page, Rect initialRect) Create a new InkAnnotation at the end of a page's annotation array.InkAnnotation(Page page, Rect initialRect, int addAfter) Create a new InkAnnotation at a specific index in the page's annotation array. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddScribble(List<Point> scribble) The vertices that define one of many scribbles in an ink annotation, in user space.voiddelete()Generate a new appearance stream with the current annotation properties.doubleThe minimum PDF version necessary to support the features used in this annotation.doubleintThe number of scribbles in the ink annotation.getScribble(int index) voidremoveScribble(int index) The vertices that define one of many scribbles in an ink annotation, in user space.voidsetAnnotationFeatureLevel(double featureLevel) Removes features not supported in the supplied version number.voidsetBorderStyle(String style) voidsetBorderStyleDashPattern(List<Double> dashPattern) voidsetBorderStyleWidth(double width) Methods inherited from class com.datalogics.PDFL.Annotation
equals, getColor, getContents, getFlags, getInteriorColor, getNormalAppearance, getOpacity, getOptionalContentMembershipDict, getPDFDict, getRect, getSubtype, getTitle, hasRichTextData, isCurrentlyVisible, setColor, setContents, setFlags, setInteriorColor, setNormalAppearance, setOpacity, setOptionalContentMembershipDict, setRect, setTitle, toString
-
Constructor Details
-
InkAnnotation
Create a new InkAnnotation at the end of a page's annotation array. To create a InkAnnotation and place it elsewhere in the page's annotation array, use the version of the constructor that takes an array position.- Parameters:
page- The page to which the InkAnnotation is added.initialRect- A rectangle specifying the annotation's bounds, specified in user space coordinates.
-
InkAnnotation
Create a new InkAnnotation at a specific index in the page's annotation array.- Parameters:
page- The page to which the annotation is added.initialRect- A rectangle specifying the annotation's bounds, specified in user space coordinates.addAfter- Where to add the annotation in the page's annotation array. To add the annotation to the end of the array, pass a value of -2 or use the alternate version of this constructor that does not take an index (this is generally what you should do unless you have a need to place the annotation at a special location in the array). Passing a value of -1 adds the annotation to the beginning of the array. Passing other negative values produces undefined results.
-
-
Method Details
-
delete
public void delete()- Overrides:
deletein classAnnotation
-
generateAppearance
Generate a new appearance stream with the current annotation properties.The resulting Form can then be used to set the annotation's appearance, such as by calling SetNormalAppearance.
- Overrides:
generateAppearancein classAnnotation
-
getAnnotationFeatureLevel
public double getAnnotationFeatureLevel()The minimum PDF version necessary to support the features used in this annotation.- Overrides:
getAnnotationFeatureLevelin classAnnotation
-
setAnnotationFeatureLevel
public void setAnnotationFeatureLevel(double featureLevel) Removes features not supported in the supplied version number.- Overrides:
setAnnotationFeatureLevelin classAnnotation
-
getScribble
- Parameters:
index- The index of the scribble to get.- Returns:
- An array of points, in order, that define the indexed scribble of the ink annotation, in user space coordinates.
-
addScribble
The vertices that define one of many scribbles in an ink annotation, in user space.- Parameters:
scribble- The array of points, in order, that define the vertices of the scribble in user space coordinates, to add to the ink annotation.
-
removeScribble
public void removeScribble(int index) The vertices that define one of many scribbles in an ink annotation, in user space.- Parameters:
index- The array of points, in order, that define the vertices of the scribble in user space coordinates, to remove from the ink annotation.
-
getNumScribbles
public int getNumScribbles()The number of scribbles in the ink annotation.- Returns:
- The number of scribbles in the ink annotation.
-
getBorderStyleWidth
public double getBorderStyleWidth() -
setBorderStyleWidth
public void setBorderStyleWidth(double width) -
getBorderStyle
-
setBorderStyle
-
getBorderStyleDashPattern
-
setBorderStyleDashPattern
-