|
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.PdfMarkupAnnot
public class PdfMarkupAnnot
This class represents a text markup annotation. A markup annotation can be used to mark up text by adding styles such as underline, squiggly, strike-out and highlight.
The style applied to the text is specified using a rectangle. The rectangle is specified by its top-left, top-right, bottom-left and bottom-right corners (exactly in this sequence).
// Create a PDF page PdfPage page = new PdfPage(); page.setMeasurementUnit(PdfMeasurement.MU_POINTS); // Create a PDF font PdfFont fontHelveticaSmall = PdfFont.create("Helvetica", 10, PdfEncodings.WINANSI); fontHelveticaSmall.setColor(Color.BLUE); page.writeText("Squiggly text markup annotation", fontHelveticaSmall, 200.0, 297); // Specify x and y coordinates of the squiggly double squiggly[] = { 200, 300, 350, 300, 200, 315, 350, 315 }; // Create a markup annotation and set its properties PdfMarkupAnnot markAnnot = new PdfMarkupAnnot( "This is a squiggly text markup annotation", PdfMarkupAnnot.STYLE_SQUIGGLY, squiggly, Color.BLUE); markAnnot.setSubject("Annotation Subject"); markAnnot.setTitle("Annotation Title"); // Add the markup annotation to the page page.addAnnotation(markAnnot);
| Field Summary | |
|---|---|
static byte |
STYLE_HIGHLIGHT
|
static byte |
STYLE_SQUIGGLY
|
static byte |
STYLE_STRIKEOUT
|
static byte |
STYLE_UNDERLINE
|
| Constructor Summary | |
|---|---|
PdfMarkupAnnot()
|
|
PdfMarkupAnnot(double[] quadPoints,
Color c)
|
|
PdfMarkupAnnot(double[] quadPoints,
int flags)
|
|
PdfMarkupAnnot(double[] quadPoints,
int flags,
Color c)
|
|
PdfMarkupAnnot(double[] quadPoints,
String subject,
String contents,
String title)
|
|
PdfMarkupAnnot(double[] quadPoints,
String subject,
String contents,
String title,
Color c)
|
|
PdfMarkupAnnot(double[] quadPoints,
String subject,
String contents,
String title,
int flags)
|
|
PdfMarkupAnnot(double[] quadPoints,
String subject,
String contents,
String title,
int flags,
Color c)
Constructs a text markup annotation with specified vertices, subject, contents, title, flags, and color. |
|
PdfMarkupAnnot(PdfRect r,
Color c)
Deprecated. Instead, use PdfMarkupAnnot(double[], Color). |
|
PdfMarkupAnnot(PdfRect r,
int flags)
Deprecated. Instead, use PdfMarkupAnnot(double[], int). |
|
PdfMarkupAnnot(PdfRect r,
int flags,
Color c)
Deprecated. Instead, use PdfMarkupAnnot(double[], int, Color). |
|
PdfMarkupAnnot(PdfRect r,
String subject,
String contents,
String title)
Deprecated. Instead, use PdfMarkupAnnot(double[], String, String, String). |
|
PdfMarkupAnnot(PdfRect r,
String subject,
String contents,
String title,
Color c)
Deprecated. Instead, use PdfMarkupAnnot(double[], String, String, String, Color). |
|
PdfMarkupAnnot(PdfRect r,
String subject,
String contents,
String title,
int flags)
Deprecated. Instead, use PdfMarkupAnnot(double[], String, String, String, int). |
|
PdfMarkupAnnot(PdfRect r,
String subject,
String contents,
String title,
int flags,
Color c)
|
|
PdfMarkupAnnot(PdfRect r,
String subject,
String contents,
String title,
int flags,
Color c,
double[] quadPoints,
int style)
Deprecated. Instead, use PdfMarkupAnnot(double[], String, String, String, int, Color). |
|
PdfMarkupAnnot(String content,
int style,
double[] quadPoints,
Color color)
|
|
| Method Summary | |
|---|---|
Object |
clone()
|
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. |
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. |
double[] |
getQuadPoints()
|
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). |
int |
getStyle()
|
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 |
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 |
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 |
setQuadPoints(double[] quadPoints)
Always in page MU |
void |
setRect(double x,
double y,
double width,
double height)
Deprecated. |
void |
setRect(double x,
double y,
double width,
double height,
int measurementUnit)
Deprecated. |
void |
setRect(PdfRect r)
Deprecated. |
void |
setRect(PdfRect r,
int measurmentUnit)
Deprecated. |
void |
setRect(Rectangle rect)
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 |
setStyle(int style)
|
| 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 byte STYLE_HIGHLIGHT
public static final byte STYLE_UNDERLINE
public static final byte STYLE_SQUIGGLY
public static final byte STYLE_STRIKEOUT
| Constructor Detail |
|---|
public PdfMarkupAnnot()
public PdfMarkupAnnot(PdfRect r,
Color c)
throws IOException,
PdfException
PdfMarkupAnnot(double[], Color).
IOException
PdfException
public PdfMarkupAnnot(double[] quadPoints,
Color c)
throws IOException,
PdfException
IOException
PdfException
public PdfMarkupAnnot(PdfRect r,
int flags,
Color c)
throws IOException,
PdfException
PdfMarkupAnnot(double[], int, Color).
IOException
PdfException
public PdfMarkupAnnot(double[] quadPoints,
int flags,
Color c)
throws IOException,
PdfException
IOException
PdfException
public PdfMarkupAnnot(PdfRect r,
int flags)
throws IOException,
PdfException
PdfMarkupAnnot(double[], int).
IOException
PdfException
public PdfMarkupAnnot(double[] quadPoints,
int flags)
throws IOException,
PdfException
IOException
PdfException
public PdfMarkupAnnot(PdfRect r,
String subject,
String contents,
String title,
Color c)
throws IOException,
PdfException
PdfMarkupAnnot(double[], String, String, String, Color).
IOException
PdfException
public PdfMarkupAnnot(double[] quadPoints,
String subject,
String contents,
String title,
Color c)
throws IOException,
PdfException
IOException
PdfException
public PdfMarkupAnnot(PdfRect r,
String subject,
String contents,
String title,
int flags,
Color c)
throws IOException,
PdfException
IOException
PdfException
public PdfMarkupAnnot(double[] quadPoints,
String subject,
String contents,
String title,
int flags,
Color c)
throws IOException,
PdfException
quadPoints - x- and y-coordinates of the top-left, top-right,
bottom-left, and bottom-right corners (x1, y1, x2,
y2, x3, y3, x4, y4)subject - text that needs to be displayed in the subject line
of the annotation's popup windowcontents - text that needs to be used as the contents of the
annotation's popup windowtitle - ext that needs to displayed as the title of the
annotation's popup windowflags - c - color of the text markup and borders of the
annotation's popup window
IOException - if an I/O error occurs.
PdfException - if an illegal argument is supplied.
public PdfMarkupAnnot(PdfRect r,
String subject,
String contents,
String title,
int flags,
Color c,
double[] quadPoints,
int style)
throws IOException,
PdfException
PdfMarkupAnnot(double[], String, String, String, int, Color).
IOException
PdfException
public PdfMarkupAnnot(PdfRect r,
String subject,
String contents,
String title,
int flags)
throws IOException,
PdfException
PdfMarkupAnnot(double[], String, String, String, int).
IOException
PdfException
public PdfMarkupAnnot(double[] quadPoints,
String subject,
String contents,
String title,
int flags)
throws IOException,
PdfException
IOException
PdfException
public PdfMarkupAnnot(PdfRect r,
String subject,
String contents,
String title)
throws IOException,
PdfException
PdfMarkupAnnot(double[], String, String, String).
IOException
PdfException
public PdfMarkupAnnot(double[] quadPoints,
String subject,
String contents,
String title)
throws IOException,
PdfException
IOException
PdfException
public PdfMarkupAnnot(String content,
int style,
double[] quadPoints,
Color color)
throws PdfException
PdfException| Method Detail |
|---|
public Object clone()
public double[] getQuadPoints()
public void setQuadPoints(double[] quadPoints)
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 measurementUnit)
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 rectanglemeasurementUnit - 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 measurmentUnit)
PdfAnnotPdfRect object as
annotation rectangle for this annotation in specified
measurement unit.
setRect in class PdfAnnotr - annotation rectangle for this annotationmeasurmentUnit - measurement unit with which the annotation rectangle
is specifiedPdfAnnot.getRect()public void setRect(Rectangle rect)
PdfAnnotRectangle object as
annotation rectangle for this annotation.
setRect in class PdfAnnotrect - annotation rectangle for this annotationPdfAnnot.getRect()public int getStyle()
public void setStyle(int style)
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(),
getDownAppearance(),
setNormalAppearance(PdfAppearanceStream),
setDownAppearance(PdfAppearanceStream),
setRolloverAppearance(PdfAppearanceStream)public void setRolloverAppearance(PdfAppearanceStream rolloverAppearance)
rolloverAppearance - the specified appearance streamsetNormalAppearance(PdfAppearanceStream),
setDownAppearance(PdfAppearanceStream),
getNormalAppearance(),
getDownAppearance(),
getRolloverAppearance()
|
Std. Ed. v2.10 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||