Package com.datalogics.PDFL
Class FreeTextAnnotation
java.lang.Object
com.datalogics.PDFL.Annotation
com.datalogics.PDFL.FreeTextAnnotation
The free text annotation allows a user to place text directly on a PDF page. An ordinary text annotation appears in a pop up window, and is attached to an icon; it represents a note added to a PDF file, and can be opened for viewing, or closed. But a free text annotation always appears open on the page. A free text annotation can be included anywhere in a PDF file by specifying the location and the CallOutLine points.
-
Constructor Summary
ConstructorsConstructorDescriptionFreeTextAnnotation(Page page, Rect initialRect, String defaultAppearance) Create a new FreeTextAnnotation at the end of a page's annotation array.FreeTextAnnotation(Page page, Rect initialRect, String defaultAppearance, int addAfter) Create a new FreeTextAnnotation at a specific index in the page's annotation array. -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete()Generate a new appearance stream with the current annotation properties.doubleThe minimum PDF version necessary to support the features used in this annotation.doublegetColor()Deprecated.The default appearance string to be used in formatting the text.Get Font face for the textdoubleGet font size for the text;A code specifiying the form of quadding (justification) to be used in displaying the annotation's text.The text color which used for drawing textvoidsetAnnotationFeatureLevel(double featureLevel) Removes features not supported in the supplied version number.voidsetBorderStyle(String style) voidsetBorderStyleDashPattern(List<Double> dashPattern) voidsetBorderStyleWidth(double width) voidDeprecated.voidsetDefaultAppearance(String arg0) The default appearance string to be used in formatting the text.voidsetFontFace(String fontName) Set Font face for the textvoidsetFontSize(double fontSize) Set font size for textvoidsetQuadding(HorizontalAlignment quadding) A code specifiying the form of quadding (justification) to be used in displaying the annotation's text.voidsetTextColor(Color textColor) Methods inherited from class com.datalogics.PDFL.Annotation
equals, getContents, getFlags, getInteriorColor, getNormalAppearance, getOpacity, getOptionalContentMembershipDict, getPDFDict, getRect, getSubtype, getTitle, hasRichTextData, isCurrentlyVisible, setContents, setFlags, setInteriorColor, setNormalAppearance, setOpacity, setOptionalContentMembershipDict, setRect, setTitle, toString
-
Constructor Details
-
FreeTextAnnotation
Create a new FreeTextAnnotation at the end of a page's annotation array. To create a FreeTextAnnotation 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 FreeTextAnnotation is added.initialRect- A rectangle specifying the annotation's bounds, specified in user space coordinates.defaultAppearance- The default appearance string to be used in formatting the text.
-
FreeTextAnnotation
Create a new FreeTextAnnotation 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.defaultAppearance- The default appearance string to be used in formatting the text.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
-
getDefaultAppearance
The default appearance string to be used in formatting the text. -
setDefaultAppearance
The default appearance string to be used in formatting the text. -
getQuadding
A code specifiying the form of quadding (justification) to be used in displaying the annotation's text. -
setQuadding
A code specifiying the form of quadding (justification) to be used in displaying the annotation's text. -
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
-
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
-
setFontSize
public void setFontSize(double fontSize) Set font size for text -
getFontSize
public double getFontSize()Get font size for the text;- Returns:
- current font size
-
setFontFace
Set Font face for the text -
getFontFace
Get Font face for the text- Returns:
- current Font face
-
getColor
Deprecated.(Deprecated, function may be removed in future, use GetInteriorColor instead) The color of the annotation. This method the same to the GetInteriorColor method.- Overrides:
getColorin classAnnotation
-
setColor
Deprecated.(Deprecated, function may be removed in future, use SetInteriorColor instead) The color of the annotation. This method the same to the SetInteriorColor method.- Overrides:
setColorin classAnnotation
-
getTextColor
The text color which used for drawing text- Returns:
- color Freetext Annotation's text
-
setTextColor
-
The text color which used for drawing text
-
-
getBorderStyleWidth
public double getBorderStyleWidth() -
setBorderStyleWidth
public void setBorderStyleWidth(double width) -
getBorderStyle
-
setBorderStyle
-
getBorderStyleDashPattern
-
setBorderStyleDashPattern
-