Package com.itextpdf.kernel.pdf.annot.da
Class AnnotationDefaultAppearance
java.lang.Object
com.itextpdf.kernel.pdf.annot.da.AnnotationDefaultAppearance
Helper class for setting annotation default appearance. The class provides setters for font color, font size and font itself.
Note that only standard font names that do not require font resources are supported.
Note that it is possible to create annotation with custom font name in DA, but this require manual resource modifications (you have to put font in DR of AcroForm and use its resource name in DA) and only Acrobat supports that workflow.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionsetColor
(DeviceCmyk cmykColor) Sets theAnnotationDefaultAppearance
's default font color.setColor
(DeviceGray grayColor) Sets theAnnotationDefaultAppearance
's default font color.Sets theAnnotationDefaultAppearance
's default font color.Sets theAnnotationDefaultAppearance
's default font.Sets theAnnotationDefaultAppearance
's default font.setFontSize
(float fontSize) Sets theAnnotationDefaultAppearance
's default font size.Gets theAnnotationDefaultAppearance
's representation asPdfString
.
-
Constructor Details
-
AnnotationDefaultAppearance
public AnnotationDefaultAppearance()Creates the default instance ofAnnotationDefaultAppearance
.The default font is
StandardAnnotationFont.Helvetica
. The default font size is 12.
-
-
Method Details
-
setFont
Sets theAnnotationDefaultAppearance
's default font.- Parameters:
-
font
- one ofstandard annotation fonts
to be set as the default one for thisAnnotationDefaultAppearance
- Returns:
-
this
AnnotationDefaultAppearance
-
setFont
Sets theAnnotationDefaultAppearance
's default font.- Parameters:
-
font
- one ofextended annotation fonts
to be set as the default one for thisAnnotationDefaultAppearance
- Returns:
-
this
AnnotationDefaultAppearance
-
setFontSize
Sets theAnnotationDefaultAppearance
's default font size.- Parameters:
-
fontSize
- font size to be set as theAnnotationDefaultAppearance
's default font size - Returns:
-
this
AnnotationDefaultAppearance
-
setColor
Sets theAnnotationDefaultAppearance
's default font color.- Parameters:
-
rgbColor
-DeviceRgb
to be set as theAnnotationDefaultAppearance
's default font color - Returns:
-
this
AnnotationDefaultAppearance
-
setColor
Sets theAnnotationDefaultAppearance
's default font color.- Parameters:
-
cmykColor
-DeviceCmyk
to be set as theAnnotationDefaultAppearance
's default font color - Returns:
-
this
AnnotationDefaultAppearance
-
setColor
Sets theAnnotationDefaultAppearance
's default font color.- Parameters:
-
grayColor
-DeviceGray
to be set as theAnnotationDefaultAppearance
's default font color - Returns:
-
this
AnnotationDefaultAppearance
-
toPdfString
Gets theAnnotationDefaultAppearance
's representation asPdfString
.- Returns:
-
the
PdfString
representation of thisAnnotationDefaultAppearance
-