public class PDFAnnot extends PDFObject implements Serializable
This class defines an annotation (commonly known as a Bookmark).
Modifier and Type | Field and Description |
---|---|
static short |
BEVELED
The border is drawn in a beveled style (faux three-dimensional) such that it looks as if it is pushed out of the
page (opposite of INSET)
|
static short |
DASHED
The border is drawn with a dashed line.
|
static short |
INSET
The border is drawn in an inset style (faux three-dimensional) such that it looks as if it is inset into the page
(opposite of BEVELED)
|
static short |
SOLID
Solid border.
|
static short |
UNDERLINED
The border is drawn as a line on the bottom of the annotation rectangle
|
Constructor and Description |
---|
PDFAnnot(int l,
int b,
int r,
int t,
PDFObject dest)
Creates a link annotation
|
PDFAnnot(int l,
int b,
int r,
int t,
PDFObject dest,
int fl,
int fb,
int fr,
int ft)
Creates a link annotation
|
PDFAnnot(int l,
int b,
int r,
int t,
String s)
Creates a text annotation
|
Modifier and Type | Method and Description |
---|---|
void |
setBorder(double width,
double[] dash)
Sets the border for the annotation.
|
void |
setBorder(short style,
double width)
Sets the border for the annotation.
|
void |
write(OutputStream os)
Should this be public??
|
getGeneration, getName, getPDFDocument, getSerialID, getType, setName, toArray, toString, writeEnd, writeStart
public static final short SOLID
public static final short DASHED
public static final short BEVELED
public static final short INSET
public static final short UNDERLINED
public PDFAnnot(int l, int b, int r, int t, String s)
l
- Left coordinateb
- Bottom coordinater
- Right coordinatet
- Top coordinates
- Text for this annotationpublic PDFAnnot(int l, int b, int r, int t, PDFObject dest)
l
- Left coordinateb
- Bottom coordinater
- Right coordinatet
- Top coordinatedest
- Destination for this link. The page will fit the display.public PDFAnnot(int l, int b, int r, int t, PDFObject dest, int fl, int fb, int fr, int ft)
l
- Left coordinateb
- Bottom coordinater
- Right coordinatet
- Top coordinatedest
- Destination for this linkfl
- Left coordinatefb
- Bottom coordinatefr
- Right coordinateft
- Top coordinate public void setBorder(short style, double width)
If the style is DASHED, then this method uses PDF's default dash scheme {3}
Important: the annotation must have been added to the document before this is used. If the annotation was created using the methods in PDFPage, then the annotation is already in the document.
style
- Border style SOLID, DASHED, BEVELED, INSET or UNDERLINED.width
- Width of the borderpublic void setBorder(double width, double[] dash)
Important: the annotation must have been added to the document before this is used. If the annotation was created using the methods in PDFPage, then the annotation is already in the document.
width
- Width of the borderdash
- Array of lengths, used for drawing the dashes. If this is null, then the default of {3} is used.public void write(OutputStream os) throws IOException
write
in class PDFObject
os
- OutputStream to send the object toIOException
- on error