Package com.itextpdf.kernel.pdf.annot.da
Class AnnotationDefaultAppearance
- java.lang.Object
-
- com.itextpdf.kernel.pdf.annot.da.AnnotationDefaultAppearance
-
public class AnnotationDefaultAppearance extends java.lang.Object
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.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
colorOperand
private static java.util.Map<ExtendedAnnotationFont,java.lang.String>
extAnnotFontNames
private float
fontSize
private java.lang.String
rawFontName
private static java.util.Map<StandardAnnotationFont,java.lang.String>
stdAnnotFontNames
-
Constructor Summary
Constructors Constructor Description AnnotationDefaultAppearance()
Creates the default instance ofAnnotationDefaultAppearance
.
-
Method Summary
-
-
-
Field Detail
-
stdAnnotFontNames
private static final java.util.Map<StandardAnnotationFont,java.lang.String> stdAnnotFontNames
-
extAnnotFontNames
private static final java.util.Map<ExtendedAnnotationFont,java.lang.String> extAnnotFontNames
-
colorOperand
private java.lang.String colorOperand
-
rawFontName
private java.lang.String rawFontName
-
fontSize
private float fontSize
-
-
Constructor Detail
-
AnnotationDefaultAppearance
public AnnotationDefaultAppearance()
Creates the default instance ofAnnotationDefaultAppearance
.The default font is
StandardAnnotationFont.Helvetica
. The default font size is 12.
-
-
Method Detail
-
setFont
public AnnotationDefaultAppearance setFont(StandardAnnotationFont font)
Sets theAnnotationDefaultAppearance
's default font.- Parameters:
font
- one ofstandard annotation fonts
to be set as the default one for thisAnnotationDefaultAppearance
- Returns:
- this
AnnotationDefaultAppearance
-
setFont
public AnnotationDefaultAppearance setFont(ExtendedAnnotationFont font)
Sets theAnnotationDefaultAppearance
's default font.- Parameters:
font
- one ofextended annotation fonts
to be set as the default one for thisAnnotationDefaultAppearance
- Returns:
- this
AnnotationDefaultAppearance
-
setFontSize
public AnnotationDefaultAppearance setFontSize(float fontSize)
Sets theAnnotationDefaultAppearance
's default font size.- Parameters:
fontSize
- font size to be set as theAnnotationDefaultAppearance
's default font size- Returns:
- this
AnnotationDefaultAppearance
-
setColor
public AnnotationDefaultAppearance setColor(DeviceRgb rgbColor)
Sets theAnnotationDefaultAppearance
's default font color.- Parameters:
rgbColor
-DeviceRgb
to be set as theAnnotationDefaultAppearance
's default font color- Returns:
- this
AnnotationDefaultAppearance
-
setColor
public AnnotationDefaultAppearance setColor(DeviceCmyk cmykColor)
Sets theAnnotationDefaultAppearance
's default font color.- Parameters:
cmykColor
-DeviceCmyk
to be set as theAnnotationDefaultAppearance
's default font color- Returns:
- this
AnnotationDefaultAppearance
-
setColor
public AnnotationDefaultAppearance setColor(DeviceGray grayColor)
Sets theAnnotationDefaultAppearance
's default font color.- Parameters:
grayColor
-DeviceGray
to be set as theAnnotationDefaultAppearance
's default font color- Returns:
- this
AnnotationDefaultAppearance
-
toPdfString
public PdfString toPdfString()
Gets theAnnotationDefaultAppearance
's representation asPdfString
.- Returns:
- the
PdfString
representation of thisAnnotationDefaultAppearance
-
setColorOperand
private void setColorOperand(float[] colorValues, java.lang.String operand)
-
setRawFontName
private void setRawFontName(java.lang.String rawFontName)
-
-