|
Gnostice PDFOne
|
|||||||||
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.PdfProAnnot
com.gnostice.pdfone.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 quadrilateral. The rectangle is specified by x and y coordinates of 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
Constant specifying a highlight to mark up text. |
static byte |
STYLE_SQUIGGLY
Constant specifying a squiggly line to mark up text. |
static byte |
STYLE_STRIKEOUT
Constant specifying a strikeout to mark up text. |
static byte |
STYLE_UNDERLINE
Constant specifying a underline to mark up text. |
Constructor Summary | |
PdfMarkupAnnot()
Zero-argument constructor. |
|
PdfMarkupAnnot(double[] quadPoints,
Color c)
Constructs a text markup annotation with specified vertices, and color. |
|
PdfMarkupAnnot(double[] quadPoints,
int flags)
Constructs a text markup annotation with specified vertices, and flags. |
|
PdfMarkupAnnot(double[] quadPoints,
int flags,
Color c)
Constructs a text markup annotation with specified vertices, flags, and color. |
|
PdfMarkupAnnot(double[] quadPoints,
String subject,
String contents,
String title)
Constructs a text markup annotation with specified vertices, and popup subject, contents and title. |
|
PdfMarkupAnnot(double[] quadPoints,
String subject,
String contents,
String title,
Color c)
Constructs a text markup annotation with specified vertices, popup subject, contents and title, and color. |
|
PdfMarkupAnnot(double[] quadPoints,
String subject,
String contents,
String title,
int flags)
Constructs a text markup annotation with specified vertices, popup subject, contents and title, and flags. |
|
PdfMarkupAnnot(double[] quadPoints,
String subject,
String contents,
String title,
int flags,
Color c)
Constructs a text markup annotation with specified vertices, popup subject, contents and 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)
Constructs a text markup annotation with specified popup contents, markup style, vertices, and 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()
Returns locations of the corners of the quadrilateral area where the text markup annotation will be displayed. |
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()
Returns style by the annotation used to mark up text. |
float |
getTransparency()
|
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)
Specifies locations of the corners of the quadrilateral area where the text markup annotation will be displayed. |
void |
setRect(double x,
double y,
double width,
double height)
Specifies annotation rectangle for this annotation at ( x , y )
with specified width and height. |
void |
setRect(double x,
double y,
double width,
double height,
int measurementUnit)
Specifies annotation rectangle for this annotation in specified measurement unit. |
void |
setRect(PdfRect r)
Specifies PdfRect object as
annotation rectangle
for this annotation. |
void |
setRect(PdfRect r,
int measurmentUnit)
Specifies PdfRect object as
annotation rectangle for this annotation in specified
measurement unit. |
void |
setRect(Rectangle rect)
Specifies Rectangle object as
annotation rectangle for this annotation. |
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)
Specifies style by the annotation used to mark up text. |
void |
setTransparency(float transparecyLevel)
|
Methods inherited from class com.gnostice.pdfone.PdfAnnot |
delete, getAnnotName, getBorderStyle, getBorderWidth, getBottom, getColor, getContents, getDashPattern, getFlags, getLeft, getRect, getRight, getSubject, getTitle, getTop, getType, hashCode, isDeleted, 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()
STYLE_HIGHLIGHT
. IMPORTANT: Do not forget to
set the corners
of the
annotation.
public PdfMarkupAnnot(PdfRect r, Color c) throws IOException, PdfException
PdfMarkupAnnot(double[], Color)
.
public PdfMarkupAnnot(double[] quadPoints, 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)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, int flags, Color c) throws IOException, PdfException
PdfMarkupAnnot(double[], int, Color)
.
public PdfMarkupAnnot(double[] quadPoints, 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)flags
- annotation attributes
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, int flags) throws IOException, PdfException
PdfMarkupAnnot(double[], int)
.
public PdfMarkupAnnot(double[] quadPoints, int flags) 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)flags
- annotation attributes
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public PdfMarkupAnnot(PdfRect r, String subject, String contents, String title, Color c) throws IOException, PdfException
PdfMarkupAnnot(double[], String, String, String, Color)
.
public PdfMarkupAnnot(double[] quadPoints, String subject, String contents, String title, 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
- text that needs to displayed as the title of the
annotation's popup windowc
- 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) throws 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
- text that needs to displayed as the title of the
annotation's popup windowflags
- annotation attributes
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)
.
public PdfMarkupAnnot(PdfRect r, String subject, String contents, String title, int flags) throws IOException, PdfException
PdfMarkupAnnot(double[], String, String, String, int)
.
public PdfMarkupAnnot(double[] quadPoints, String subject, String contents, String title, int flags) 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
- text that needs to displayed as the title of the
annotation's popup windowflags
- annotation attributes
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public PdfMarkupAnnot(PdfRect r, String subject, String contents, String title) throws IOException, PdfException
PdfMarkupAnnot(double[], String, String, String)
.
public PdfMarkupAnnot(double[] quadPoints, String subject, String contents, String title) 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
- text that needs to displayed as the title of the
annotation's popup window
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public PdfMarkupAnnot(String content, int style, double[] quadPoints, Color color) throws PdfException, IOException
content
- text that needs to be used as the contents of the
annotation's popup windowstyle
- constant specifying the style used to mark up textquadPoints
- x- and y-coordinates of the top-left, top-right,
bottom-left, and bottom-right corners (x1, y1, x2,
y2, x3, y3, x4, y4)color
- color of the text markup and borders of the
annotation's popup window
PdfException
- if an illegal argument is supplied.
IOException
Method Detail |
public Object clone()
public double[] getQuadPoints()
setQuadPoints(double[])
public void setQuadPoints(double[] quadPoints) throws PdfException
quadPoints
- locations of the corners of the quadrilateral area
where
quadPoints[0], quadPoints[1])
=
top-left cornerquadPoints[2], quadPoints[3])
=
top-right cornerquadPoints[4], quadPoints[5])
=
bottom-left cornerquadPoints[6], quadPoints[7])
=
bottom-right cornerPdfException
getQuadPoints()
public void setRect(double x, double y, double width, double height)
PdfAnnot
x
, 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 PdfAnnot
x
- 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 PdfAnnot
x
- 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)
PdfAnnot
PdfRect
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 PdfAnnot
r
- annotation rectangle for this annotationPdfAnnot.getRect()
public void setRect(PdfRect r, int measurmentUnit)
PdfAnnot
PdfRect
object as
annotation rectangle for this annotation in specified
measurement unit.
setRect
in class PdfAnnot
r
- annotation rectangle for this annotationmeasurmentUnit
- measurement unit with which the annotation rectangle
is specifiedPdfAnnot.getRect()
public void setRect(Rectangle rect)
PdfAnnot
Rectangle
object as
annotation rectangle for this annotation.
setRect
in class PdfAnnot
rect
- annotation rectangle for this annotationPdfAnnot.getRect()
public int getStyle()
setStyle(int)
public void setStyle(int style)
style
- constant specifying the stylegetStyle()
public void setTransparency(float transparecyLevel)
public float getTransparency()
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 annotationPdfProAnnot.getPopup()
public PdfAppearanceStream getDownAppearance()
PdfProAnnot.getNormalAppearance()
,
PdfProAnnot.getDownAppearance()
,
PdfProAnnot.setNormalAppearance(PdfAppearanceStream)
,
PdfProAnnot.setRolloverAppearance(PdfAppearanceStream)
,
PdfProAnnot.setDownAppearance(PdfAppearanceStream)
public void setDownAppearance(PdfAppearanceStream downAppearance)
PdfProAnnot.getNormalAppearance()
,
PdfProAnnot.getDownAppearance()
,
PdfProAnnot.getRolloverAppearance()
,
PdfProAnnot.setNormalAppearance(PdfAppearanceStream)
,
PdfProAnnot.setRolloverAppearance(PdfAppearanceStream)
public PdfAppearanceStream getNormalAppearance()
PdfProAnnot.getDownAppearance()
,
PdfProAnnot.getRolloverAppearance()
,
PdfProAnnot.setNormalAppearance(PdfAppearanceStream)
,
PdfProAnnot.setDownAppearance(PdfAppearanceStream)
,
PdfProAnnot.setRolloverAppearance(PdfAppearanceStream)
public void setNormalAppearance(PdfAppearanceStream normalAppearance)
normalAppearance
- the specified appearance streamPdfProAnnot.setDownAppearance(PdfAppearanceStream)
,
PdfProAnnot.setRolloverAppearance(PdfAppearanceStream)
,
PdfProAnnot.getNormalAppearance()
,
PdfProAnnot.getDownAppearance()
,
PdfProAnnot.getRolloverAppearance()
public PdfAppearanceStream getRolloverAppearance()
PdfProAnnot.getNormalAppearance()
,
PdfProAnnot.getDownAppearance()
,
PdfProAnnot.setNormalAppearance(PdfAppearanceStream)
,
PdfProAnnot.setDownAppearance(PdfAppearanceStream)
,
PdfProAnnot.setRolloverAppearance(PdfAppearanceStream)
public void setRolloverAppearance(PdfAppearanceStream rolloverAppearance)
rolloverAppearance
- the specified appearance streamPdfProAnnot.setNormalAppearance(PdfAppearanceStream)
,
PdfProAnnot.setDownAppearance(PdfAppearanceStream)
,
PdfProAnnot.getNormalAppearance()
,
PdfProAnnot.getDownAppearance()
,
PdfProAnnot.getRolloverAppearance()
|
Pro. Ed. v5.0.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |