|
Gnostice PDFOne Java
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.gnostice.pdfone.PdfAnnot
com.gnostice.pdfone.PdfLineAnnot
public class PdfLineAnnot
This class represents a line annotation. A line annotation is represented by a straight line. The line has a starting point and an ending point. A line annotation can have a popup dialog box.
// Create a pdf page PdfPage page = new PdfPage(); // Create a PDF font PdfFont fontHelvetica = PdfFont.create("Helvetica", 15,PdfEncodings.WINANSI); fontHelvetica.setColor(Color.BLUE); // Write text on the page page.writeText("Line Annotations", fontHelvetica, 80, 100); // Create an array of x-y coordinates for the starting and // end points of the line annotation double endPts[] = { 80, 150, 250, 150 }; // Create a line annotation and set its properties PdfLineAnnot lineAnnot1 = new PdfLineAnnot(endPts, Color.BLUE); lineAnnot1.setTitle("Title"); lineAnnot1.setSubject("Line Annotation"); lineAnnot1.setContents("This is a Line Annotation"); lineAnnot1.setInteriorColor(Color.red); lineAnnot1.setLineStartStyle(PdfLineAnnot.LINEENDSTYLE_DIAMOND); lineAnnot1.setLineEndStyle(PdfLineAnnot.LINEENDSTYLE_CLOSED_ARROW); lineAnnot1.setBorderStyle(PdfLineAnnot.BORDERSTYLE_INSET); lineAnnot1.setBorderWidth(3); // Add the line annotation to page page.addAnnotation(lineAnnot1);
| Field Summary | |
|---|---|
static int |
LINEENDSTYLE_BUTT
|
static int |
LINEENDSTYLE_CIRCLE
|
static int |
LINEENDSTYLE_CLOSED_ARROW
|
static int |
LINEENDSTYLE_DIAMOND
|
static int |
LINEENDSTYLE_NONE
|
static int |
LINEENDSTYLE_OPEN_ARROW
|
static int |
LINEENDSTYLE_RCLOSED_ARROW
|
static int |
LINEENDSTYLE_ROPEN_ARROW
|
static int |
LINEENDSTYLE_SLASH
|
static int |
LINEENDSTYLE_SQUARE
|
| Constructor Summary | |
|---|---|
PdfLineAnnot()
|
|
PdfLineAnnot(double[] points,
Color c)
|
|
PdfLineAnnot(double[] points,
int flags)
|
|
PdfLineAnnot(double[] points,
int flags,
Color c)
|
|
PdfLineAnnot(double[] points,
String subject,
String contents,
String title)
|
|
PdfLineAnnot(double[] points,
String subject,
String contents,
String title,
Color c)
|
|
PdfLineAnnot(double[] points,
String subject,
String contents,
String title,
int flags)
|
|
PdfLineAnnot(double[] points,
String subject,
String contents,
String title,
int flags,
Color c)
|
|
PdfLineAnnot(double[] points,
String subject,
String contents,
String title,
int flags,
Color c,
int lineStartStyle,
int lineEndStyle,
Color interior)
Constructs a new line annotation with specified starting and end points, title, subject, contents, flags, line color, line-end styles, and line-end fill color. |
|
PdfLineAnnot(PdfRect r,
Color c)
Deprecated. Instead, use PdfLineAnnot(double[], Color). |
|
PdfLineAnnot(PdfRect r,
int flags)
Deprecated. Instead, use PdfLineAnnot(double[], int). |
|
PdfLineAnnot(PdfRect r,
int flags,
Color c)
Deprecated. Instead, use PdfLineAnnot(double[], int, Color). |
|
PdfLineAnnot(PdfRect r,
String subject,
String contents,
String title)
Deprecated. Instead, use PdfLineAnnot(double[], String, String, String). |
|
PdfLineAnnot(PdfRect r,
String subject,
String contents,
String title,
Color c)
Deprecated. Instead, use PdfLineAnnot(double[], String, String, String, Color). |
|
PdfLineAnnot(PdfRect r,
String subject,
String contents,
String title,
int flags)
Deprecated. Instead, use PdfLineAnnot(double[], String, String, String, int). |
|
PdfLineAnnot(PdfRect r,
String subject,
String contents,
String title,
int flags,
Color c)
Deprecated. Instead, use PdfLineAnnot(double[], String, String, String, int, Color). |
|
PdfLineAnnot(PdfRect r,
String subject,
String contents,
String title,
int flags,
Color c,
int lineStartStyle,
int lineEndStyle,
Color interior)
Deprecated. Instead, use PdfLineAnnot(double[], String, String, String, int, Color, int, int, Color). |
|
| Method Summary | |
|---|---|
Object |
clone()
|
String |
getCaption()
|
PdfAppearanceStream |
getDownAppearance()
Returns the appearance stream that needs to be used by a viewer application to display the annotation/form field when the user places the mouse pointer over the annotation/form field and holds down the mouse button. |
Color |
getInteriorColor()
|
double[] |
getLeaderLineArray()
|
int |
getLineEndStyle()
|
int |
getLineStartStyle()
|
PdfAppearanceStream |
getNormalAppearance()
Returns the default appearance stream that needs to be used by a viewer application to display the annotation/form field (that is, when the user is not interacting with the annotation/form field). |
PdfPopUpAnnot |
getPopup()
Returns a popup annotation that needs to be used by a viewer application to display the popup window for this annotation. |
PdfAppearanceStream |
getRolloverAppearance()
Returns the appearance stream that needs to be used by a viewer application to display the annotation when the user places the mouse pointer over the annotation (and does not hold down the mouse button). |
double |
getX1()
|
double |
getX2()
|
double |
getY1()
|
double |
getY2()
|
void |
setCaption(String caption)
|
void |
setDownAppearance(PdfAppearanceStream downAppearance)
Specifies the appearance stream that needs to be used by a viewer application to display the annotation/form field when the user places the mouse pointer over the annotation/form field and holds down the mouse button. |
void |
setInteriorColor(Color interiorColor)
|
void |
setLeaderLineArray(double[] leaderLineArray)
|
void |
setLineEndStyle(int lineEndStyle)
|
void |
setLineStartStyle(int lineStartStyle)
|
void |
setNormalAppearance(PdfAppearanceStream normalAppearance)
Specifies the default appearance stream that needs to be used by a viewer application to display the annotation/form field (that is, when the user is not interacting with the annotation/form field). |
void |
setPoints(double[] points)
|
void |
setPoints(double[] points,
int measurementUnit)
|
void |
setPopup(PdfPopUpAnnot popup,
boolean overridePopUpProperties)
Specifies a popup annotation that needs to be used by a viewer application to display the popup window for this annotation. |
void |
setRect(double x,
double y,
double width,
double height)
Deprecated. |
void |
setRect(double x,
double y,
double width,
double height,
int mu)
Deprecated. |
void |
setRect(PdfRect r)
Deprecated. |
void |
setRect(PdfRect r,
int mu)
Deprecated. |
void |
setRect(Rectangle r)
Deprecated. |
void |
setRolloverAppearance(PdfAppearanceStream rolloverAppearance)
Specifies the appearance stream that needs to be used by a viewer application to display the annotation/form field when the user places the mouse pointer over the annotation/form field (and does not hold down the mouse button). |
void |
setX1(double x1)
|
void |
setX2(double x2)
|
void |
setY1(double y1)
|
void |
setY2(double y2)
|
| Methods inherited from class com.gnostice.pdfone.PdfAnnot |
|---|
getAnnotName, getBorderStyle, getBorderWidth, getBottom, getColor, getContents, getDashPattern, getFlags, getLeft, getRect, getRight, getSubject, getTitle, getTop, getType, hashCode, isShowRect, setAnnotName, setBorderStyle, setBorderWidth, setColor, setContents, setDashPattern, setFlags, setShowRect, setSubject, setTitle |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int LINEENDSTYLE_SQUARE
public static final int LINEENDSTYLE_CIRCLE
public static final int LINEENDSTYLE_DIAMOND
public static final int LINEENDSTYLE_OPEN_ARROW
public static final int LINEENDSTYLE_CLOSED_ARROW
public static final int LINEENDSTYLE_NONE
public static final int LINEENDSTYLE_BUTT
public static final int LINEENDSTYLE_ROPEN_ARROW
public static final int LINEENDSTYLE_RCLOSED_ARROW
public static final int LINEENDSTYLE_SLASH
| Constructor Detail |
|---|
public PdfLineAnnot()
public PdfLineAnnot(PdfRect r,
String subject,
String contents,
String title,
int flags,
Color c,
int lineStartStyle,
int lineEndStyle,
Color interior)
throws IOException,
PdfException
PdfLineAnnot(double[], String, String, String, int, Color, int, int, Color).
IOException
PdfException
public PdfLineAnnot(double[] points,
String subject,
String contents,
String title,
int flags,
Color c,
int lineStartStyle,
int lineEndStyle,
Color interior)
throws IOException,
PdfException
points - x1, y1, x2, and y2, which are coordinates of
the starting point (x1, y1) and end point (x2, y2)
of the linesubject - text that needs to be displayed in the title bar of
the annotation's popup windowcontents - text that needs to be used as the contents of the
annotation's popup windowtitle - text that needs to be used as the subject of the
annotation's popup windowflags - flag or combined
value of flags representing characteristics of the
annotationc - color of the linelineStartStyle - constant specifying
line-end style of the annotation's starting pointlineEndStyle - constant specifying
line-end style of the annotation's end pointinterior - color used to fill the interior of the line endings
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
public PdfLineAnnot(PdfRect r,
String subject,
String contents,
String title)
throws IOException,
PdfException
PdfLineAnnot(double[], String, String, String).
IOException
PdfException
public PdfLineAnnot(double[] points,
String subject,
String contents,
String title)
throws IOException,
PdfException
IOException
PdfException
public PdfLineAnnot(PdfRect r,
String subject,
String contents,
String title,
Color c)
throws IOException,
PdfException
PdfLineAnnot(double[], String, String, String, Color).
IOException
PdfException
public PdfLineAnnot(double[] points,
String subject,
String contents,
String title,
Color c)
throws IOException,
PdfException
IOException
PdfException
public PdfLineAnnot(PdfRect r,
String subject,
String contents,
String title,
int flags)
throws IOException,
PdfException
PdfLineAnnot(double[], String, String, String, int).
IOException
PdfException
public PdfLineAnnot(double[] points,
String subject,
String contents,
String title,
int flags)
throws IOException,
PdfException
IOException
PdfException
public PdfLineAnnot(PdfRect r,
String subject,
String contents,
String title,
int flags,
Color c)
throws IOException,
PdfException
PdfLineAnnot(double[], String, String, String, int, Color).
IOException
PdfException
public PdfLineAnnot(double[] points,
String subject,
String contents,
String title,
int flags,
Color c)
throws IOException,
PdfException
IOException
PdfException
public PdfLineAnnot(PdfRect r,
int flags)
throws IOException,
PdfException
PdfLineAnnot(double[], int).
IOException
PdfException
public PdfLineAnnot(double[] points,
int flags)
throws IOException,
PdfException
IOException
PdfException
public PdfLineAnnot(PdfRect r,
int flags,
Color c)
throws IOException,
PdfException
PdfLineAnnot(double[], int, Color).
IOException
PdfException
public PdfLineAnnot(double[] points,
int flags,
Color c)
throws IOException,
PdfException
IOException
PdfException
public PdfLineAnnot(PdfRect r,
Color c)
throws IOException,
PdfException
PdfLineAnnot(double[], Color).
IOException
PdfException
public PdfLineAnnot(double[] points,
Color c)
throws IOException,
PdfException
IOException
PdfException| Method Detail |
|---|
public Object clone()
public void setPoints(double[] points)
throws PdfException
PdfException
public void setPoints(double[] points,
int measurementUnit)
throws PdfException
PdfException
public void setRect(double x,
double y,
double width,
double height)
PdfAnnotx, y)
with specified width and height.
The position (x, y), and dimensions
width and height are applied in the
default measurement unit of the page to which the annotation
is added.
setRect in class PdfAnnotx - x-coordinate of the annotation rectangley - y-coordinate of the annotation rectanglewidth - width of the annotation rectangleheight - height of the annotation rectanglePdfAnnot.getRect()
public void setRect(double x,
double y,
double width,
double height,
int mu)
PdfAnnot
setRect in class PdfAnnotx - x-coordinate of the annotation rectangley - y-coordinate of the annotation rectanglewidth - width of the annotation rectangleheight - height of the annotation rectanglemu - measurement unit with which the annotation rectangle
is specifiedPdfAnnot.getRect()public void setRect(PdfRect r)
PdfAnnotPdfRect object as
annotation rectangle
for this annotation.
The position and size of the rectangle are applied in the default measurement unit of the page to which the annotation is added.
setRect in class PdfAnnotr - annotation rectangle for this annotationPdfAnnot.getRect()
public void setRect(PdfRect r,
int mu)
PdfAnnotPdfRect object as
annotation rectangle for this annotation in specified
measurement unit.
setRect in class PdfAnnotr - annotation rectangle for this annotationmu - measurement unit with which the annotation rectangle
is specifiedPdfAnnot.getRect()public void setRect(Rectangle r)
PdfAnnotRectangle object as
annotation rectangle for this annotation.
setRect in class PdfAnnotr - annotation rectangle for this annotationPdfAnnot.getRect()public int getLineStartStyle()
public void setLineStartStyle(int lineStartStyle)
public int getLineEndStyle()
public void setLineEndStyle(int lineEndStyle)
public double getX1()
public void setX1(double x1)
public double getX2()
public void setX2(double x2)
public double getY1()
public void setY1(double y1)
public double getY2()
public void setY2(double y2)
public double[] getLeaderLineArray()
public void setLeaderLineArray(double[] leaderLineArray)
throws PdfException
PdfExceptionpublic String getCaption()
public void setCaption(String caption)
public Color getInteriorColor()
public void setInteriorColor(Color interiorColor)
public PdfPopUpAnnot getPopup()
public void setPopup(PdfPopUpAnnot popup,
boolean overridePopUpProperties)
popup - popup annotation that needs to be used as the popup
windowoverridePopUpProperties - whether a viewer application should override the
properties of the popup annotation with those of
this annotationgetPopup()public PdfAppearanceStream getDownAppearance()
getNormalAppearance(),
getDownAppearance(),
setNormalAppearance(PdfAppearanceStream),
setRolloverAppearance(PdfAppearanceStream),
setDownAppearance(PdfAppearanceStream)public void setDownAppearance(PdfAppearanceStream downAppearance)
getNormalAppearance(),
getDownAppearance(),
getRolloverAppearance(),
setNormalAppearance(PdfAppearanceStream),
setRolloverAppearance(PdfAppearanceStream)public PdfAppearanceStream getNormalAppearance()
getDownAppearance(),
getRolloverAppearance(),
setNormalAppearance(PdfAppearanceStream),
setDownAppearance(PdfAppearanceStream),
setRolloverAppearance(PdfAppearanceStream)public void setNormalAppearance(PdfAppearanceStream normalAppearance)
normalAppearance - the specified appearance streamsetDownAppearance(PdfAppearanceStream),
setRolloverAppearance(PdfAppearanceStream),
getNormalAppearance(),
getDownAppearance(),
getRolloverAppearance()public PdfAppearanceStream getRolloverAppearance()
getNormalAppearance(),