|
Gnostice PDFOne
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gnostice.pdfone.PdfObject
com.gnostice.pdfone.PdfStream
com.gnostice.pdfone.PdfAppearanceStream
This class represents an appearance stream. An appearance stream is
a rectangle
containing PDF
elements such as shapes, images, and text. After creating an
appearance stream object, it can be used to provide an alternate
appearance for PDF elements such as form fields and annotations.
The x-y coordinate of the top-left corner of the rectangle will be
relative to the x-y coordinate of the top-left corner of the form
field or annotation for which it used.
After creating an PdfAppearanceStream
object with a
specified rectangle, use methods such as
drawCircle()
or drawImage()
to specify how the
object that use the appearance stream should be rendered. Next, you
can any of the following methods to add the appearance stream to a
form field or annotation object:
Field Summary |
Constructor Summary | |
PdfAppearanceStream(PdfRect rect)
Constructs an appearance stream with specified rectangle. |
|
PdfAppearanceStream(PdfRect rect,
int measurementUnit)
Constructs an appearance stream with specified rectangle and measurement unit. |
Method Summary | |
Object |
clone()
|
void |
drawCircle(PdfPoint center,
double radius,
PdfPen pen,
PdfBrush brush)
Draws a circle inside the rectangle of the appearance stream. |
void |
drawEllipse(PdfPoint p1,
PdfPoint p2,
PdfPen pen,
PdfBrush brush)
Draws an ellipse inside the rectangle of the appearance stream. |
void |
drawImage(PdfImage img)
Draws specified image inside the rectangle of the appearance stream. |
void |
drawImage(PdfImage img,
PdfRect rect)
Draws specified image within a specified rectangular area inside the rectangle of the appearance stream. |
void |
drawLine(PdfPoint start,
PdfPoint end,
PdfPen pen)
Draws a line inside the rectangle of the appearance stream. |
void |
drawPolygon(double[] xPoints,
double[] yPoints,
int nPoints,
PdfPen pen,
PdfBrush brush)
Draws a polygon inside the rectangle of the appearance stream. |
void |
drawPolyline(double[] xPoints,
double[] yPoints,
int nPoints,
PdfPen pen)
Draws a polyline inside the rectangle of the appearance stream. |
void |
drawRect(PdfRect rect,
PdfPen pen,
PdfBrush brush)
Draws a rectangular box inside the rectangle of the appearance stream. |
void |
writeText(String text,
PdfFont font,
PdfPoint p,
PdfTextFormatter tf)
Writes specified text at specified position with specified font and text formatting inside the rectangle of the appearance stream. |
void |
writeText(String text,
PdfFont font,
PdfRect rect,
PdfTextFormatter tf)
Writes specified text within specified rectangle with specified font and text formatting inside the rectangle of the appearance stream. |
void |
writeText(String text,
PdfFont font,
PdfRect rect,
PdfTextFormatter tf,
int measurementUnit)
Writes specified text within specified rectangle with specified font, text formatting, and measurement unit inside the rectangle of the appearance stream. |
Methods inherited from class com.gnostice.pdfone.PdfStream |
decompress, equals, getBuffer, getDecodeParms, getDictionary, getFilters, setBuffer |
Methods inherited from class com.gnostice.pdfone.PdfObject |
getGenerationNumber, getObjectNumber, setGenerationNumber, setObjectNumber, toString |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public PdfAppearanceStream(PdfRect rect, int measurementUnit)
rect
- rectangle where the contents of the appearance
stream will be renderedmeasurementUnit
- measurement unit with which PDF elements will be
rendered in the rectanglePdfMeasurement
public PdfAppearanceStream(PdfRect rect)
rect
- rectangle where the contents of the appearance
stream will be renderedMethod Detail |
public Object clone()
clone
in class PdfStream
public void drawLine(PdfPoint start, PdfPoint end, PdfPen pen) throws IOException
start
- position from which the line needs to be drawnend
- position to which the line needs to be drawnpen
- pen used to stroke the line
IOException
- if an illegal argument is supplied.public void drawEllipse(PdfPoint p1, PdfPoint p2, PdfPen pen, PdfBrush brush) throws IOException
p1
- position of the top-left corner of the ellipse's bounding boxp2
- position of the bottom-right corner of the ellipse's bounding boxpen
- pen used to stroke the ellipsebrush
- brush used to fill the ellipse
IOException
- if an illegal argument is supplied.public void drawCircle(PdfPoint center, double radius, PdfPen pen, PdfBrush brush) throws IOException
center
- position of the center of the circleradius
- radius of the circlepen
- pen used to stroke the circlebrush
- brush used to fill the circle
IOException
- if an illegal argument is supplied.public void drawPolyline(double[] xPoints, double[] yPoints, int nPoints, PdfPen pen) throws IOException, PdfException
xPoints[0], yPoints[0]
) and
(xPoints[1], yPoints[1]
). The second line will be
between (xPoints[1], yPoints[1]
and
(xPoints[2], yPoints[2]
. The rest of the lines
will be drawn in a similar manner until the last line ends at
(xPoints[nPoints], yPoints[nPoints]
.
xPoints
- array containing x-coordinates of the vertices of
the polylineyPoints
- array containing y-coordinates of the vertices of
the polylinenPoints
- number of points that need to be connected together
to draw the polylinepen
- pen used to stroke the polyline
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawPolygon(double[] xPoints, double[] yPoints, int nPoints, PdfPen pen, PdfBrush brush) throws IOException, PdfException
xPoints[0], yPoints[0]
) and
(xPoints[1], yPoints[1]
). The second edge will be
between (xPoints[1], yPoints[1]
) and
(xPoints[2], yPoints[2]
). Other edges of the
polygon will be drawn in a similar manner until the last edge
is drawn between
(xPoints[nPoints], yPoints[nPoints]
) and
(xPoints[0], yPoints[0]
).
xPoints
- array containing x-coordinates of the vertices of
the polygonyPoints
- array containing y-coordinates of the vertices of
the polygonnPoints
- number of edges of the polygonpen
- pen used to stroke the polygonbrush
- brush used to fill the polygon
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawRect(PdfRect rect, PdfPen pen, PdfBrush brush) throws IOException
rect
- rectangular box that needs to be drawnpen
- pen used to stroke the rectangular boxbrush
- brush used to fill the rectangular box
IOException
- if an I/O error occurs.public void drawImage(PdfImage img, PdfRect rect) throws IOException, PdfException
img
- image that needs to be drawnrect
- rectangular area within which the image needs to be
tightly fit
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(PdfImage img) throws IOException, PdfException
img
- image that needs to be drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void writeText(String text, PdfFont font, PdfPoint p, PdfTextFormatter tf) throws IOException, PdfException
text
- text that needs to be renderedfont
- font with which the text needs to be renderedp
- position at which the text needs to be renderedtf
- formatting with which the text needs to be rendered
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void writeText(String text, PdfFont font, PdfRect rect, PdfTextFormatter tf) throws IOException, PdfException
text
- text that needs to be renderedfont
- font with which the text needs to be renderedrect
- rectangle within which the text needs to be renderedtf
- formatting with which the text needs to be rendered
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void writeText(String text, PdfFont font, PdfRect rect, PdfTextFormatter tf, int measurementUnit) throws IOException, PdfException
text
- text that needs to be renderedfont
- font with which the text needs to be renderedrect
- rectangle within which the text needs to be renderedtf
- formatting with which the text needs to be renderedmeasurementUnit
- measurement unit with which the rect
is specified
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied
|
Pro. Ed. v5.0.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |