Package pdf
Class PDFAnnot
- java.lang.Object
-
- pdf.PDFObject
-
- pdf.PDFAnnot
-
- All Implemented Interfaces:
java.io.Serializable
public class PDFAnnot extends PDFObject implements java.io.Serializable
This class defines an annotation (commonly known as a Bookmark).
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static shortBEVELEDThe 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 shortDASHEDThe border is drawn with a dashed line.static shortINSETThe 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 shortSOLIDSolid border.static shortUNDERLINEDThe border is drawn as a line on the bottom of the annotation rectangle-
Fields inherited from class pdf.PDFObject
objser, pdfDocument
-
-
Constructor Summary
Constructors Modifier Constructor Description PDFAnnot(int l, int b, int r, int t, java.lang.String s)Creates a text annotationPDFAnnot(int l, int b, int r, int t, PDFObject dest)Creates a link annotationPDFAnnot(int l, int b, int r, int t, PDFObject dest, int fl, int fb, int fr, int ft)Creates a link annotationprotectedPDFAnnot(java.lang.String s, int l, int b, int r, int t)This is used to create an annotation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidsetBorder(double width, double[] dash)Sets the border for the annotation.voidsetBorder(short style, double width)Sets the border for the annotation.voidwrite(java.io.OutputStream os)Should this be public??-
Methods inherited from class pdf.PDFObject
getPDFDocument, getSerialID, getType, toArray, toString, writeEnd, writeStart
-
-
-
-
Field Detail
-
SOLID
public static final short SOLID
Solid border. The border is drawn as a solid line.- See Also:
- Constant Field Values
-
DASHED
public static final short DASHED
The border is drawn with a dashed line.- See Also:
- Constant Field Values
-
BEVELED
public static final 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)- See Also:
- Constant Field Values
-
INSET
public static final 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)- See Also:
- Constant Field Values
-
UNDERLINED
public static final short UNDERLINED
The border is drawn as a line on the bottom of the annotation rectangle- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PDFAnnot
protected PDFAnnot(java.lang.String s, int l, int b, int r, int t)This is used to create an annotation.- Parameters:
s- Subtype for this annotationl- Left coordinateb- Bottom coordinater- Right coordinatet- Top coordinate
-
PDFAnnot
public PDFAnnot(int l, int b, int r, int t, java.lang.String s)Creates a text annotation- Parameters:
l- Left coordinateb- Bottom coordinater- Right coordinatet- Top coordinates- Text for this annotation
-
PDFAnnot
public PDFAnnot(int l, int b, int r, int t, PDFObject dest)Creates a link annotation- Parameters:
l- Left coordinateb- Bottom coordinater- Right coordinatet- Top coordinatedest- Destination for this link. The page will fit the display.
-
PDFAnnot
public PDFAnnot(int l, int b, int r, int t, PDFObject dest, int fl, int fb, int fr, int ft)Creates a link annotation- Parameters:
l- Left coordinateb- Bottom coordinater- Right coordinatet- Top coordinatedest- Destination for this linkfl- Left coordinatefb- Bottom coordinatefr- Right coordinateft- Top coordinate
Rectangle describing what part of the page to be displayed (must be in User Coordinates)
-
-
Method Detail
-
setBorder
public void setBorder(short style, double width)Sets the border for the annotation. By default, no border is defined.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.
- Parameters:
style- Border style SOLID, DASHED, BEVELED, INSET or UNDERLINED.width- Width of the border
-
setBorder
public void setBorder(double width, double[] dash)Sets the border for the annotation. Unlike the other method, this produces a dashed border.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.
- Parameters:
width- Width of the borderdash- Array of lengths, used for drawing the dashes. If this is null, then the default of {3} is used.
-
-