|
Gnostice PDFOne
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gnostice.pdfone.PdfStdDocument
com.gnostice.pdfone.PdfProDocument
com.gnostice.pdfone.PdfDocument
This class is used to create, read from, and write to PDF
documents. To create a new PDF file
and then write to it, a PdfDocument
object should be
created with a PdfWriter
object. (Henceforth, this
will be known as "creation mode.") To
read from an existing PDF file
,
and possibly make changes and save it to a new file, a
PdfDocument
object should be created with a
PdfReader
object. (This will be referred as "reading
mode" in the rest of this documentation.)
The PdfDocument
class offers numerous methods to
work with elements such as text, images, shapes, tables, form
fields, annotations, bookmarks, and pages in PDF documents.
When content is written to a new PdfDocument
object,
a default PdfPage
object is automatically created
and added to the PdfDocument
. This
PdfPage
also becomes PdfDocument
's
"current page." Whenever data is written to a document without
explicitly specifying a page range, the data is automatically
written to the PdfDocument
's current page. This
does not change even when new PdfPage
objects have
been added to the PdfDocument
object. To make a page
that is to be added set as the current page, the overloaded
PdfStdDocument.add(PdfPage p, boolean setAsCurrentPage)
method should be
used. To write content to a specific page that is not necessarily
the current page, methods that have a page range argument should be
used.
While writing to a PdfDocument
object, the position
where the content should appear is very important. The coordinates
of the position is always made in reference to the top-left corner
the PdfDocument
's current page. Whenever
coordinates, position, or sizes are used, they are usually applied
in terms of the document's current measurement unit, which can be
pixels, twips, points, inches, or centimeters. However, in
situations where a measurement unit cannot be applied or
determined, the measurement unit will be by default points.
Every document has a default pen setting and a default brush setting. The pen for example is used to stroke the borders when a rectangle is drawn. In the same example, the brush would be used when the area bounded by the rectangle is filled.
PdfWriter
,
PdfReader
,
PdfPage
Field Summary | |
static int |
ALIGNMENT_CENTER
Constant for aligning form field text to the center. |
static int |
ALIGNMENT_LEFT
Constant for aligning form field text to the left. |
static int |
ALIGNMENT_RIGHT
Constant for aligning form field text to right. |
boolean |
autoPaginate
Document property determining whether a new page will be automatically appended when content written to current page starts overflowing the page's confines. |
static int |
MERGE_INCLUDE_ALL
Flag for inclusion of annotations, bookmarks, document-level actions, page-level actions, and form fields when merging documents. |
static int |
MERGE_INCLUDE_ANNOTATIONS
Flag for inclusion of annotations when merging documents. |
static int |
MERGE_INCLUDE_BOOKMARKS
Flag for inclusion of bookmarks when merging documents. |
static int |
MERGE_INCLUDE_DOCUMENT_ACTIONS
Flag for inclusion of document-level actions when merging documents. |
static int |
MERGE_INCLUDE_FORMFIELDS
Flag for inclusion of form fields when merging documents. |
static int |
MERGE_INCLUDE_PAGE_ACTIONS
Flag for inclusion of page-level actions when merging documents. |
static String |
VERSION_1_4
PDF version 1.4 |
static String |
VERSION_1_5
PDF version 1.5 |
static String |
VERSION_1_6
PDF version 1.6 |
Constructor Summary | |
PdfDocument(PdfReader r)
Constructs a new PdfDocument with a
PdfReader object. |
|
PdfDocument(PdfWriter w)
Constructs a new PdfDocument object with a
PdfWriter object. |
Method Summary | |
void |
add(PdfPage p)
Adds specified PdfPage to this
PdfDocument . |
void |
add(PdfPage p,
boolean setAsCurrentPage)
Adds specified PdfPage to this
PdfDocument and, if
setAsCurrentPage is true, sets the
PdfPage as the PdfDocument 's
current page. |
void |
addAction(int namedAction)
Adds a named action that needs to be executed by viewer applications when they display the document. |
void |
addAction(int actionType,
int pageNum)
Adds a go-to action to the document. |
void |
addAction(int event,
int actionType,
String javascript)
Adds a Javascript action to specified document-level event. |
void |
addAction(int actionType,
String javascriptOrURI)
Sets this document to execute action specified by javascriptOrURI when the document is displayed. |
void |
addAction(int actionType,
String applicationToLaunch,
boolean isPrint,
String parameterToApplication)
Add a document-level action for launching a specified application with specified parameters or open/print specified document. |
void |
addAnnotation(PdfAnnot annotation,
int pageNo)
Adds specified annotation to specified page. |
void |
addAnnotationList(List annotList,
int pageNo)
Adds a specified list of annotations to a specified page. |
void |
addAnnotationList(List annotList,
int pageNo,
boolean removeExistingAnnots)
Adds a specified list of annotations to a specified page, and removes or keeps existing annotations. |
void |
addAnnotationList(List annotList,
String[] pageRanges,
boolean removeExistingAnnots,
int measurementUnit)
Adds specified list of annotations to specified pages at locations in specified units, and also remove or keep existing annotations in the document. |
void |
addAnnotationList(List annotList,
String[] pageRanges,
int measurementUnit)
Adds specified list of annotations to specified pages at locations in specified units. |
PdfBookmark |
addBookmark(int namedAction,
String title,
PdfBookmark parent)
Returns a new child bookmark (added under parent )
with specified title, and sets the bookmark to perform
specified named action. |
PdfBookmark |
addBookmark(String title,
PdfBookmark parent,
int pageNo)
Returns a new child bookmark (added under parent )
with specified title, and sets the bookmark to lead to
specified page. |
PdfBookmark |
addBookmark(String title,
PdfBookmark parent,
int pageNo,
double left,
double top,
double zoom)
Returns a new child bookmark (added under parent )
with specified title, and sets the bookmark to lead to
specified location on specified page with specified zoom. |
PdfBookmark |
addBookmark(String title,
PdfBookmark parent,
int pageNo,
double x,
double y,
double width,
double height)
Returns a new child bookmark (added under parent ),
and sets the bookmark's
destination
to a rectangular area with specified top-left
corner (x , y ), width and
height. |
PdfBookmark |
addBookmark(String title,
PdfBookmark parent,
int pageNo,
double pos,
int fit)
Returns a new child bookmark (added under parent ),
and sets the bookmark's destination specified by
pageNo , pos and fit . |
PdfBookmark |
addBookmark(String title,
PdfBookmark parent,
int pageNo,
int fit)
Returns a new child bookmark (added under parent )
with specified title, and sets the bookmark's destination
specified by pageNo and fit . |
PdfBookmark |
addBookmark(String title,
PdfBookmark parent,
int pageNo,
PdfRect rect)
Returns a new child bookmark (added under parent )
with specified title and sets the bookmark to lead to
specified rectanglular area on specified page. |
PdfBookmark |
addBookmark(String title,
PdfBookmark parent,
int pageNo,
Rectangle rect)
Returns a new child bookmark (added under parent )
with specified title, and sets the bookmark to lead to
specified rectangular area on specified page. |
PdfBookmark |
addBookmark(String title,
PdfBookmark parent,
String applicationToLaunch,
boolean print)
Adds a new child bookmark (under parent ), and
sets it to launch a specified application or print a specified
file. |
PdfBookmark |
addBookmark(String title,
PdfBookmark parent,
String javascriptOrURI,
int actionType)
Adds a new child bookmark (under parent ) and
sets it execute a Javascript script or resolve a URI (Uniform
Resource Identifier). |
PdfBookmark |
addBookmark(String title,
PdfBookmark parent,
String pdfFileName,
int pageNo,
boolean newWindow)
Returns a new child bookmark (added under parent ),
and sets it to open a specified page on a specified PDF
document in the same window or a new window of the viewer. |
void |
addDefaultFormFont(PdfFont font)
|
void |
addDefaultFormFontList(List fontList)
|
void |
addFooterImage(PdfImage img,
int position,
boolean underlay,
String pageRange)
Adds PdfImage object to footer of pages in
specified page range. |
void |
addFooterImage(String path,
int position,
boolean underlay,
String pageRange)
Adds image, specified by its pathname, to footer of pages in specified page range. |
void |
addFooterText(String text,
PdfFont font,
int position,
boolean underlay,
String pageRange)
Adds specified text to footer of pages in specified page range. |
void |
addFooterText(String text,
PdfFont font,
PdfRect rect,
int alignment,
int firstLinePosition,
int position,
boolean underlay,
String pageRange)
Adds a text footer to a specfied page range with specified font, first-line position, vertical/horizontal alignment, and underlay settings. |
void |
addFormField(PdfFormField formField,
int pageNo)
Add specified form field to specified page. |
void |
addFormField(PdfFormField f,
String[] pageRanges)
Adds children of specified form field (radio button group or check box group) to a specified page ranges. |
void |
addFormFieldList(List formFieldList,
int pageNo)
Add a list of form field to a specified page. |
void |
addHeaderImage(PdfImage img,
int position,
boolean underlay,
String pageRange)
Adds a PdfImage object to header of pages in
specified page range. |
void |
addHeaderImage(String path,
int position,
boolean underlay,
String pageRange)
Adds image, specified by its pathname, to footer of pages in specified page range. |
void |
addHeaderText(String text,
PdfFont font,
int position,
boolean underlay,
String pageRange)
Adds specified text to header of pages in specified page range. |
void |
addHeaderText(String text,
PdfFont font,
PdfRect rect,
int alignment,
int firstLinePosition,
int position,
boolean underlay,
String pageRange)
Adds specified text as a header on a specified rectangular area in specified pages with specified font, alignment, first-line position, vertical/horizontal position, and underlay settings. |
void |
addTable(PdfTable table,
double x,
double y,
int pageNo)
Renders a specified table at a specfied location on specified page. |
void |
addTable(PdfTable table,
double x,
double y,
int pageNo,
PdfFont f)
Renders a specified table at a specfied location on specified page with specified font. |
void |
addThumbnailImage(String path,
int pageNo)
Adds specified image as thumbnail for specified page. |
void |
addToFiltersList(int filter)
Adds a filter to the list of filters used to encode stream objects in this document. |
void |
addWatermarkImage(PdfImage image,
int position,
boolean applyPageMargins,
double angle,
boolean underlay,
String pageRange)
Adds PdfImage object as watermark with its exact
position determined by position and
applyPageMargins . |
void |
addWatermarkImage(PdfImage image,
int position,
double angle,
boolean underlay,
String pageRange)
Adds PdfImage object as watermark on pages in
specified page range. |
void |
addWatermarkImage(String path,
int position,
boolean applyPageMargins,
double angle,
boolean underlay,
String pageRange)
Adds image, specified by its pathname, as watermark with its exact position determined by position and
applyPageMargins on pages in specified page
range. |
void |
addWatermarkImage(String path,
int position,
double angle,
boolean underlay,
String pageRange)
Adds image, specified by its pathname, as watermark on pages in specified page range. |
void |
addWatermarkText(String text,
PdfFont font,
int position,
boolean applyPageMargins,
double angle,
boolean underlay,
String pageRange)
Adds specified text as watermark with its exact position determined by position and
applyPageMargins on pages in specified page
range. |
void |
addWatermarkText(String text,
PdfFont font,
int position,
double angle,
boolean underlay,
String pageRange)
Adds specified text as watermark on pages in specified page range. |
void |
addWatermarkText(String text,
PdfFont font,
PdfRect rect,
int alignment,
int firstLinePosition,
int position,
double angle,
boolean underlay,
String pageRange)
Adds specified text as a watermark to a specified rectangular area on a specified pages with specified font, alignment, first-line position, position, rotation, and underlay settings. |
void |
appendPagesFrom(PdfDocument d,
String pageRange)
Extracts specified pages from a specified document and then appends them to this document. |
void |
appendPagesFrom(String path,
String pageRange)
Extracts specified pages from a document (specified by its pathname) and then appends them to this document. |
void |
attachDocument(String fileName)
Adds specified file as an attachment to the document. |
void |
deleteFormFields()
Removes all form fields in the document. |
void |
deleteFormFields(int type)
Removes all form fields of specified type in the document. |
void |
deleteFormFields(String name)
Removes all form fields with specified name in the document. |
void |
deleteFormFieldsOnPage(int pageNo)
Removes all form fields on specified page. |
void |
deleteFormFieldsOnPage(int pageNo,
int type)
Removes all form fields of specified type on specified page. |
void |
deleteFormFieldsOnPage(int pageNo,
String name)
Removes all form fields with specified name in specified page. |
void |
deletePages(String pageRange)
Deletes pages in specified page range from this PdfDocument . |
void |
disableAllMargins(String pageRange)
Disables all margins on pages in specified page range. |
void |
drawArc(PdfRect rect,
double startAngle,
double arcAngle)
Draws an arc on the current page of this PdfDocument . |
void |
drawArc(PdfRect rect,
double startAngle,
double arcAngle,
String pageRange)
Draws an arc on pages in specified page range. |
void |
drawBezierCurve(double startX,
double startY,
double ctrlX,
double ctrlY,
double endX,
double endY,
boolean isFill,
boolean isStroke)
Draws a Bézier curve with a single control point on current page of this PdfDocument . |
void |
drawBezierCurve(double startX,
double startY,
double ctrlX,
double ctrlY,
double endX,
double endY,
boolean isFill,
boolean isStroke,
String pageRange)
Draws a Bézier curve with a single control point on pages in specified page range in this PdfDocument . |
void |
drawBezierCurve(double startX,
double startY,
double ctrlX1,
double ctrlY1,
double ctrlX2,
double ctrlY2,
double endX,
double endY,
boolean isFill,
boolean isStroke)
Draws a Bézier curve with two control points on current page of this PdfDocument . |
void |
drawBezierCurve(double startX,
double startY,
double ctrlX1,
double ctrlY1,
double ctrlX2,
double ctrlY2,
double endX,
double endY,
boolean isFill,
boolean isStroke,
String pageRange)
Draws a Bézier curve with two control points on pages in specified page range on this PdfDocument . |
void |
drawCircle(double x,
double y,
double radius,
boolean isFill,
boolean isStroke)
Draws a circle with specified radius on this PdfDocument 's current page. |
void |
drawCircle(double x,
double y,
double radius,
boolean isFill,
boolean isStroke,
String pageRange)
Draws a circle with specified radius on pages in specified page range on this PdfDocument . |
void |
drawEllipse(double x1,
double y1,
double x2,
double y2,
boolean isFill,
boolean isStroke)
Draws an ellipse on this PdfDocument 's current
page. |
void |
drawEllipse(double x1,
double y1,
double x2,
double y2,
boolean isFill,
boolean isStroke,
String pageRange)
Draws an ellipse on pages in specified page range on this PdfDocument 's current page. |
void |
drawImage(PdfImage img,
double x,
double y)
Draws specified image at position ( x , y )
on this PdfDocument 's current page. |
void |
drawImage(PdfImage img,
double x,
double y,
double rotation)
Draws specified image rotated by rotation
degrees at position (x , y ) on this
PdfDocument 's current page. |
void |
drawImage(PdfImage img,
double x,
double y,
double width,
double height)
Draws specified image at position ( x , y ) with specified height and
width on this PdfDocument 's current page. |
void |
drawImage(PdfImage img,
double x,
double y,
double width,
double height,
double rotation)
Draws specified image rotated by rotation degrees
at position (x , y ) with specified
height and width on this PdfDocument 's current
page. |
void |
drawImage(PdfImage img,
double x,
double y,
double width,
double height,
double rotation,
String pageRange)
Draws specified image rotated by rotation degrees
at position (x , y ) with specified
height and width on pages in specified page range. |
void |
drawImage(PdfImage img,
double x,
double y,
double width,
double height,
String pageRange)
Draws specified image at position ( x , y ) with specified height and
width on pages in specified page range. |
void |
drawImage(PdfImage img,
double x,
double y,
double rotation,
String pageRange)
Draws specified image rotated by rotation degrees
at position (x , y ) on pages in
specified page range. |
void |
drawImage(PdfImage img,
double x,
double y,
String pageRange)
Draws specified image at position ( x , y ) on pages in specified page
range. |
void |
drawImage(PdfImage img,
PdfPoint pt)
Draws specified image at specified point on this PdfDocument 's current page. |
void |
drawImage(PdfImage img,
PdfPoint pt,
double rotation)
Draws specified image rotated by rotation degrees
at specified point on this PdfDocument 's current
page. |
void |
drawImage(PdfImage img,
PdfPoint pt,
double width,
double height)
Draws specified image at specified point with specified width and height on this PdfDocument 's current page. |
void |
drawImage(PdfImage img,
PdfPoint pt,
double width,
double height,
double rotation)
Draws specified image rotated by rotation
degrees at specified point on this PdfDocument 's
current page. |
void |
drawImage(PdfImage img,
PdfPoint pt,
double width,
double height,
double rotation,
String pageRange)
Draws specified image rotated by rotation degrees
at specified point with specified width and height on pages in
the specified page range. |
void |
drawImage(PdfImage img,
PdfPoint pt,
double width,
double height,
String pageRange)
Draws specified image at specified point with specified width and height on pages in the specified page range. |
void |
drawImage(PdfImage img,
PdfPoint pt,
double rotation,
String pageRange)
Draws specified image rotated by rotation degrees
at specified point on pages in the specified page range. |
void |
drawImage(PdfImage img,
PdfPoint pt,
String pageRange)
Draws specified image at specified point on pages in specified page range. |
void |
drawImage(PdfImage img,
PdfRect rect)
Draws specified image inside specified rectangle on this PdfDocument 's current page. |
void |
drawImage(PdfImage img,
PdfRect rect,
double rotation)
Draws specified image rotated by rotation degrees
inside specified rectangle on this PdfDocument 's
current page. |
void |
drawImage(PdfImage img,
PdfRect rect,
double rotation,
String pageRange)
Draws specified image rotated by rotation degrees
inside specified rectangle on pages in specified range. |
void |
drawImage(PdfImage img,
PdfRect rect,
String pageRange)
Draws specified image inside specified rectangle on pages in specified page range. |
void |
drawImage(String path,
double x,
double y)
Draws image specified by its pathname at position ( x , y ) on this
PdfDocument 's current page. |
void |
drawImage(String path,
double x,
double y,
double rotation)
Draws image specified by its pathname rotated at rotation degrees at position
(x , y ) on this
PdfDocument 's current page. |
void |
drawImage(String path,
double x,
double y,
double width,
double height)
Draws image specified by its pathname at position (x, y) with specified width and height on this PdfDocument 's current page. |
void |
drawImage(String path,
double x,
double y,
double width,
double height,
double rotation)
Draws image specified by its pathname rotated by rotation degrees at position
(x , y ) with specified width and
height on this PdfDocument 's current page. |
void |
drawImage(String path,
double x,
double y,
double width,
double height,
double rotation,
String pageRange)
Draws image specified by its pathname rotated by rotation degrees at position
(x , y ) with specified width and
height on pages in specified page range. |
void |
drawImage(String path,
double x,
double y,
double width,
double height,
String pageRange)
Draws image specified by its pathname at position ( x , y )with specified width and
height on pages in specified page range. |
void |
drawImage(String path,
double x,
double y,
double rotation,
String pageRange)
Draws image specified by its pathname rotated by rotation degrees at position (x ,
y )on pages in specified range. |
void |
drawImage(String path,
double x,
double y,
String pageRange)
Draws image specified by its pathname at position ( x , y ) on pages in specified page
range. |
void |
drawImage(String path,
PdfPoint pt)
Draws image specified by its pathname at specified point on this PdfDocument 's current page. |
void |
drawImage(String path,
PdfPoint pt,
double rotation)
Draws image specified by its pathname rotated by rotation degrees at specified point on this
PdfDocument 's current page. |
void |
drawImage(String path,
PdfPoint pt,
double width,
double height)
Draws image specified by its pathname at specified point with specified width and height on this PdfDocument 's
current page. |
void |
drawImage(String path,
PdfPoint pt,
double width,
double height,
double rotation)
Draws image specified by its pathname rotated by rotation degrees at specified point with
specified width and height on this PdfDocument 's
current page. |
void |
drawImage(String path,
PdfPoint pt,
double width,
double height,
double rotation,
String pageRange)
Draws image specified by its pathname rotated by rotation degrees at specified position with
specified width and height on pages in specified page range. |
void |
drawImage(String path,
PdfPoint pt,
double width,
double height,
String pageRange)
Draws image specified by its pathname at specified position with specified width and height on pages in specified range. |
void |
drawImage(String path,
PdfPoint pt,
double rotation,
String pageRange)
Draws image specified by its pathname rotated by rotation degrees at specified point on pages in
specified range. |
void |
drawImage(String path,
PdfPoint pt,
String pageRange)
Draws image specified by its pathname at specified point on pages in specified page range. |
void |
drawImage(String path,
PdfRect rect)
Draws image specified by its pathname inside specified rectangle on this PdfDocument 's current page. |
void |
drawImage(String path,
PdfRect rect,
double rotation)
Draws image specified by its pathname rotated by rotation degrees inside specified rectangle on
this PdfDocument 's current page. |
void |
drawImage(String path,
PdfRect rect,
double rotation,
String pageRange)
Draws image specified by its pathname rotated by rotation degrees inside specified rectangle on
pages in specified page range. |
void |
drawImage(String path,
PdfRect rect,
String pageRange)
Draws image specified by its pathname inside specified rectangle on pages in specified page range. |
void |
drawLine(double startx,
double starty,
double endx,
double endy)
Draws a line between position ( startx , starty ) and
(endx , endy ) on this
PdfDocument 's current page. |
void |
drawLine(double startx,
double starty,
double endx,
double endy,
String pageRange)
Draws a line between position ( startx ,
starty ) and (endx ,
endy ) on pages in specified page range. |
void |
drawLine(PdfPoint start,
PdfPoint end)
Draws a line from start to end
on this PdfDocument 's current page. |
void |
drawLine(PdfPoint start,
PdfPoint end,
String pageRange)
Draws a line from start to end on
pages in specified page range. |
void |
drawPie(double x,
double y,
double width,
double height,
double startAngle,
double arcAngle,
boolean isFill,
boolean isStroke,
String pageRange)
Draws a pie segment on pages in specified page range. |
void |
drawPie(int x,
int y,
int width,
int height,
double startAngle,
double arcAngle,
boolean isFill,
boolean isStroke)
Draws a pie segment on this PdfDocument 's
current page. |
void |
drawPolygon(double[] xPoints,
double[] yPoints,
int nPoints,
boolean isFill,
boolean isStroke)
Draws a polygon on this PdfDocument 's current
page. |
void |
drawPolygon(double[] xPoints,
double[] yPoints,
int nPoints,
boolean isFill,
boolean isStroke,
String pageRange)
Draws a polygon on pages in specified page range. |
void |
drawPolyline(double[] xPoints,
double[] yPoints,
int nPoints)
Draws a polyline on this PdfDocument 's current
page. |
void |
drawPolyline(double[] xPoints,
double[] yPoints,
int nPoints,
String pageRange)
Draws a polyline on pages in specified page range. |
void |
drawRect(double x,
double y,
double width,
double height)
Draws a rectangle at position ( x ,
y ) with specified width and
height on this PdfDocument 's
current page. |
void |
drawRect(double x,
double y,
double width,
double height,
boolean isFill,
boolean isStroke)
Draws a rectangle on this PdfDocument 's current
page at position (x , y ) with
specified width , height , pen,
and brush settings. |
void |
drawRect(double x,
double y,
double width,
double height,
boolean isFill,
boolean isStroke,
String pageRange)
Draws a rectangle on pages in specified page range page at position ( x , y ) with specified
width , height , brush, and pen
settings. |
void |
drawRect(double x,
double y,
double width,
double height,
String pageRange)
Draws a rectangle at position ( x ,
y ) with specified width and
height on pages in specified page range. |
void |
drawRect(PdfRect r)
Draws rectangle r on this
PdfDocument 's current page. |
void |
drawRect(PdfRect r,
String pageRange)
Draws specified PdfRect object on pages in
specified page range. |
void |
drawRect(Rectangle r)
Draws specified Rectangle object on this
PdfDocument 's current page. |
void |
drawRect(Rectangle r,
String pageRange)
Draws specified Rectangle object on pages in
specified page range. |
void |
drawRoundRect(double x,
double y,
double width,
double height,
double arcWidth,
double arcHeight,
boolean isFill,
boolean isStroke)
Draws a rectangle with rounded corners on this PdfDocument 's current page. |
void |
drawRoundRect(double x,
double y,
double width,
double height,
double arcWidth,
double arcHeight,
boolean isFill,
boolean isStroke,
String pageRange)
Draws a rectangle with rounded corners on pages in specified page range. |
void |
drawSquare(double x,
double y,
double length)
Draws a square on this PdfDocument 's current
page. |
void |
drawSquare(double x,
double y,
double length,
boolean isFill,
boolean isStroke)
Draws a square with specified brush and pen settings on this PdfDocument 's current page. |
void |
drawSquare(double x,
double y,
double length,
boolean isFill,
boolean isStroke,
String pageRange)
Draws a square with specified pen and brush settings on pages in specified page range. |
void |
drawSquare(double x,
double y,
double length,
String pageRange)
Draws a square on pages in specified page range. |
void |
embedFont(PdfFont fontToBeEmbedded)
Embeds specified font in the document. |
void |
embedFont(PdfFont fontToBeEmbedded,
String originalFont)
Embeds specified font in place of another font already existing in the document. |
void |
enableAllMargins(String pageRange)
Enables all margins on pages in specified page range. |
void |
exportToFDF(File fdfFile)
Writes interactive forms data of the PDF document to an FDF (Forms Data Format) file. |
void |
extractPagesTo(String path,
String pageRange)
Extracts pages in specified page range and places them in a file specified by its pathname. |
void |
extractPagesTo(String path,
String pageRange,
String extractAsVersion,
boolean openAfterExtraction)
Extracts pages in specified page range in specified PDF version and places them in a new file specified by its pathname. |
void |
flattenFormFields()
Flattens all form fields in the document. |
void |
flattenFormFields(boolean flattenWithNewValue)
Flattens all form fields with or without retaining new values. |
void |
flattenFormFields(int type)
Flatens form fields of specified type. |
void |
flattenFormFields(int type,
boolean flattenWithNewValue)
Flattens a form field of specified type with or without retaining new values. |
void |
flattenFormFields(String name)
Flattens form fields with specified name. |
void |
flattenFormFields(String name,
boolean flattenWithNewValue)
Flattens form fields having specified name with or without retaining new values. |
void |
flattenFormFieldsOnPage(int pageNo)
Flattens all form fields on specified page. |
void |
flattenFormFieldsOnPage(int pageNo,
boolean flattenWithNewValue)
Flatten form fields on specified page with or without retaining new values. |
void |
flattenFormFieldsOnPage(int pageNo,
int type)
Flatten form fields of specified type in specified page. |
void |
flattenFormFieldsOnPage(int pageNo,
int type,
boolean flattenWithNewValue)
Flattens form fields of specified type on specified page with or without retaining new values. |
void |
flattenFormFieldsOnPage(int pageNo,
String name)
Flattens form fields with specified name on specified page. |
void |
flattenFormFieldsOnPage(int pageNo,
String name,
boolean flattenWithNewValue)
Flattens all form fields with specified name on specified page with or without applying new values. |
List |
getAllAnnotations()
Returns a list of all annotations in the document. |
List |
getAllAnnotations(int type)
Get all annotations of specified type. |
void |
getAllAnnotations(int type,
List listToPopulate)
Populates a specified list with all annotations of specified type in the document. |
void |
getAllAnnotations(List listToPopulate)
Populates a specified list with all annotations in the document. |
List |
getAllAnnotationsOnPage(int pageNo)
Returns a list of all annotations in specified page. |
List |
getAllAnnotationsOnPage(int pageNo,
int type)
Returns a list of annotations of specified type in specified page. |
void |
getAllAnnotationsOnPage(int pageNo,
int type,
List listToPopulate)
Populates a specified list with all annotations of specified type in a specified page. |
void |
getAllAnnotationsOnPage(int pageNo,
List listToPopulate)
Populates a specified list with all annotations in a specified page. |
List |
getAllFontBaseNames()
Returns a list of base names of all fonts used in the document. |
List |
getAllFontBaseNames(String pageRange)
Returns a list of basenames of all fonts used in pages in the specified page range. |
List |
getAllFormFields()
Returns a list of all form fields in the document. |
List |
getAllFormFields(int type)
Returns a list of all form fields of specified type. |
List |
getAllFormFields(String name)
Returns a list of all form fields with specified name. |
List |
getAllFormFieldsOnPage(int pageNo)
Returns a list of all form fields on specified page. |
List |
getAllFormFieldsOnPage(int pageNo,
int type)
Returns a list of all form fields in specified page. |
List |
getAllFormFieldsOnPage(int pageNo,
String name)
Populates a list of all form fields with specified name in specified page. |
ArrayList |
getAttachments()
Returns a list of file attachments in the document. |
String |
getAuthor()
Returns "author" document property of this document. |
PdfBookmark |
getBookmarkRoot()
Returns a PdfBookmark object that points to the
root of the bookmark tree of this PdfDocument . |
int |
getCompressionLevel()
Returns constant identifying compression level of this Pdfdocument . |
Date |
getCreationDate()
Returns "creation date" document property for this property. |
int |
getDefaultFieldAlignment()
Returns default text alignment for form fields in the document. |
Color |
getDefaultFormFontColor()
Returns default color for form field text in the document. |
List |
getDefaultFormFontList()
|
PdfEncryption |
getEncryptor()
Retrieves current encryption settings of this PdfDocument . |
PdfBookmark |
getFirstBookmark()
Returns first bookmark in this PdfDocument 's
document outline. |
PdfFont |
getFont()
Returns default font used to render text elements in the document. |
String |
getKeywords()
Returns "keywords" document property of the document. |
int |
getMeasurementUnit()
Returns default measurement unit currently in use for this PdfDocument . |
Date |
getModifiedDate()
Returns "modified date" documentation property of this document. |
PdfPage |
getPage(int pageNo)
Returns a PdfPage object specified by page number
in this document. |
int |
getPageCount()
Returns number of pages in this PdfDocument . |
int |
getPageLayout()
Returns constant identifying page layout used as default when opening this document. |
int |
getPageMode()
Returns constant identifying this PdfDocument 's
default page mode. |
String |
getProducer()
Returns "producer" document property of the document. |
PdfReader |
getReader()
Returns PdfReader object currently used with
this PdfDocument . |
String |
getSubject()
Returns "subject" document property of the document. |
String |
getTitle()
Returns "title" document property of the document. |
String |
getVersion()
Returns constant identifying this PdfDocument 's
PDF version. |
int |
getViewerPreferences()
Returns viewer application preferences of this document. |
PdfWriter |
getWriter()
Returns PdfWriter object currently used with
this PdfDocument . |
File |
getWriterOutputFile()
Returns output file specified for this document. |
String |
getXMLMetadata()
Returns XML metadata of this PdfDocument . |
void |
importFromFDF(File fileName)
Save interactive forms data imported from a specified FDF (Forms Data Format) file. |
void |
insertPagesFrom(com.gnostice.pdfone.PdfStdDocument d,
String pageRange,
int insertAfterPage)
Insert specified pages from a specified document at specified page position in this document. |
void |
insertPagesFrom(String path,
String pageRange,
int insertAfterPage)
Insert specified pages from a document (specified by its pathname) at specified page position in this document. |
boolean |
isAutoAdjustFieldTextHeight()
Returns whether the size of text inside text box, list box and combo box form fields will be adjusted by the viewer application so that the text is fully accommodated inside the fields without any cropping. |
boolean |
isOpenAfterSave()
Returns whether document is set to be executed after data is saved to file. |
boolean |
isOverrideFieldAppearanceStreams()
Returns whether text associated with all form fields in the document are by default displayed by viewer applications. |
void |
merge(List docList)
Merges this document with documents in specified list. |
void |
merge(List docList,
int mergeOptions)
Merges this document with documents in specified list using specified merging options. |
void |
merge(PdfDocument d)
Merges this document with another document. |
void |
merge(PdfDocument d,
int mergeOptions)
Merges this document with another document using specified merging options. |
void |
merge(String path)
Merges this document with a document specified by its pathname. |
void |
merge(String path,
int mergeOptions)
Merges this document with a document (specified by its pathname) using specified merging options. |
void |
removeBookmarkRoot()
Removes all bookmarks existing in the document. |
void |
removeThumbnailImage(String pageRange)
Removes thumbnail image for specified pages. |
void |
setAuthor(String s)
Specifies "author" document property for this document. |
void |
setAutoAdjustFieldTextHeight(boolean autoAdjustFieldTextHeight)
Specifies whether the size of text inside text box, list box and combo box form fields needs to be adjusted by the viewer application so that the text is fully accommodated inside the fields without any cropping. |
void |
setBrushColor(Color c)
Specifies default color for this PdfDocument 's
brush. |
void |
setCompressionLevel(int compressionLevel)
Specifies compression level for this PdfDocument . |
void |
setCph(PdfCustomPlaceholderHandler cph)
Specifies an object that handles the onCustomPlaceHolder()
event. |
void |
setDefaultFieldAlignment(int defualtFieldAlignment)
Specifies default text alignment for form fields in the document. |
void |
setDefaultFormFontColor(Color defaultFormFontColor)
Specifies default color for form field text in the document. |
void |
setDefaultFormFontIndex(int defaultFormFontIndex)
|
void |
setDefaultFormFontList(List fontList)
|
void |
setEncryptor(PdfEncryption encrypto)
Specify encryption settings for this PdfDocument . |
void |
setFont(PdfFont defaultFont)
Specifies default font that needs to be used to render text elements in the document. |
void |
setKeywords(String s)
Specifies "keywords" document property for this document. |
void |
setMeasurementUnit(int measurementUnit)
Specifies default measurement unit to be used for this PdfDocument . |
void |
setOnBookmarkMerge(PdfBookmarkMergeHandler onBookmarkMerge)
Specifies an object that handles the onBookmarkMerge()
event. |
void |
setOnNeedFileName(PdfNeedFileNameHandler pnfnh)
Specifies an object that handles the onNeedFileName()
event. |
void |
setOnRenameField(PdfFormFieldRenameHandler pfrh)
Specifies an object that handles the onRenameField()
event. |
void |
setOpenAfterSave(boolean openAfterSave)
Specifies whether document needs to be launched by the Operating System (OS) shell program (such as explorer.exe in Windows ™ ) after it is saved to a file. |
void |
setOverrideFieldAppearanceStreams(boolean overrideAppearanceStreams)
Specifies whether text associated with all form fields in the document need to be displayed by default. |
void |
setPageLayout(int value)
Specifies default page layout to be used when opening this document. |
void |
setPageMode(int value)
Specifies default page mode with which this PdfDocument needs to be opened. |
void |
setPenCapStyle(int capStyle)
Specifies default shape of endpoints of paths in this PdfDocument . |
void |
setPenColor(Color color)
Specifies default color for this PdfDocument 's
pen. |
void |
setPenDashGap(double gap)
Specifies length of gaps in default dash pattern of this PdfDocument 's pen. |
void |
setPenDashLength(double length)
Specifies length of dashes in default dash pattern of this PdfDocument 's pen. |
void |
setPenDashPhase(double phase)
Specifies length of phase of default dash pattern of this PdfDocument 's pen. |
void |
setPenJoinStyle(int joinStyle)
Specifies default shape of joints of paths that connect at an angle for this PdfDocument 's
pen. |
void |
setPenMiterLimit(int limit)
Specifies default miter limit for this PdfDocument 's pen. |
void |
setPenWidth(double width)
Specifies default width for this PdfDocument 's
pen. |
void |
setPrintAfterSave(boolean printAfterSave)
Specifies whether the document needs to be sent to a printer for printing after it is saved to a file. |
void |
setProducer(String s)
Specifies "producer" document property for this document. |
void |
setReader(PdfReader r)
Specifies PdfReader object to be used with this
PdfDocument . |
void |
setSubject(String s)
Specifies "subject" document property for this document. |
void |
setTitle(String s)
Specifies "title" document property for this document. |
void |
setVersion(String version)
Specifies PDF version of this PdfDocument . |
void |
setViewerPreferences(int value)
Specifies viewer application preferences for this document. |
void |
setWriter(PdfWriter w)
Specifies PdfWriter object to be used with this
PdfDocument . |
void |
split(int pages)
Extract specified number of consecutive pages from the PDF document and place them in new PDF documents. |
void |
split(String pageRange)
Extracts all pages in the specified page range to a new document. |
void |
stitch(int stitchToPageNo,
int stitchFromPageNo,
double offsetX,
double offsetY)
Overlays all content from a specified page to another page with specified ofsets. |
long |
write()
Saves contents in this PdfDocument to
the PdfDocument 's output stream or file and
returns number of bytes that was saved. |
void |
writeText(String str)
Writes specified text at current position on this PdfDocument 's current page. |
void |
writeText(String str,
boolean wrap)
Writes specified text with specified wrap setting at current position on this PdfDocument 's current
page. |
void |
writeText(String str,
boolean wrap,
String pageRange)
Writes specified text with specified wrap setting at current position on pages in specified page range. |
void |
writeText(String str,
double x,
double y)
Writes specified text at position ( x ,
y ) on this PdfDocument 's
current page. |
void |
writeText(String str,
double x,
double y,
boolean wrap)
Writes specified text with specified wrap setting at position ( x , y ) on this
PdfDocument 's current page. |
void |
writeText(String str,
double x,
double y,
boolean wrap,
String pageRange)
Writes specified text with specified wrap setting at position ( x , y ) on pages in
specified page range. |
void |
writeText(String str,
double x,
double y,
double rotation)
Writes specified text rotated by rotation degrees
at position (x , y ) on this
PdfDocument 's current page. |
void |
writeText(String str,
double x,
double y,
double rotation,
String pageRange)
Writes specified text rotated by rotation
degrees at position (x , y ) on
pages in specified page range. |
void |
writeText(String str,
double x,
double y,
int alignment)
Writes specified text with specified alignment at position ( x , y ) on this
PdfDocument 's current page. |
void |
writeText(String str,
double x,
double y,
int alignment,
boolean wrap)
Writes specified text with specified alignment and wrap setting at position ( x , y )
on this PdfDocument 's current page. |
void |
writeText(String str,
double x,
double y,
int alignment,
boolean wrap,
String pageRange)
Writes specified text with specified alignment and wrap setting at position ( x , y )
on pages in specified page range. |
void |
writeText(String str,
double x,
double y,
int alignment,
String pageRange)
Writes specified text with specified alignment at position ( x , y ) on pages in
specified range. |
void |
writeText(String str,
double x,
double y,
String pageRange)
Writes specified text at position ( x , y )
on pages in specified page range. |
void |
writeText(String str,
int alignment)
Writes specified text with specified alignment at current position on this PdfDocument 's current
page. |
void |
writeText(String str,
int alignment,
boolean wrap)
Writes specified text with specified alignment and specified wrap setting at current position on this PdfDocument 's current page. |
void |
writeText(String str,
int alignment,
boolean wrap,
String pageRange)
Writes specified text with specified alignment and wrap setting at current position on pages in specified page range. |
void |
writeText(String str,
int alignment,
String pageRange)
Writes specified text with specified alignment at current position on pages in specified page range. |
void |
writeText(String str,
PdfFont f)
Writes specified text with specified font on this PdfDocument 's current page. |
void |
writeText(String str,
PdfFont f,
boolean wrap)
Writes specified text with specified wrap setting and font on this PdfDocument 's current page. |
void |
writeText(String str,
PdfFont f,
boolean wrap,
String pageRange)
Writes specified text with specified font and wrap setting on pages in specified page range. |
void |
writeText(String str,
PdfFont f,
double x,
double y)
Writes specified text with specified font at position ( x , y ) on this
PdfDocument 's current page. |
void |
writeText(String str,
PdfFont f,
double x,
double y,
boolean wrap)
Writes specified text with specified font and wrap setting at position ( x , y ) on this
PdfDocument 's current page. |
void |
writeText(String str,
PdfFont f,
double x,
double y,
boolean wrap,
String pageRange)
Writes specified text with specified font and wrap setting at position ( x , y ) on pages in
specified page range. |
void |
writeText(String str,
PdfFont f,
double x,
double y,
double rotation)
Writes specified text rotated by rotation
degrees with specified font at position (x ,
y ) on this PdfDocument 's
current page. |
void |
writeText(String str,
PdfFont f,
double x,
double y,
double rotation,
String pageRange)
Writes specified text rotated by rotation
degrees with specified font at position (x ,
y ) on pages in specified page range. |
void |
writeText(String str,
PdfFont f,
double x,
double y,
String pageRange)
Writes specified text with specified font at position ( x , y ) on pages in
specified page range. |
void |
writeText(String str,
PdfFont f,
int alignment)
Writes specified text with specified font and alignment on this PdfDocument 's current page. |
void |
writeText(String str,
PdfFont f,
int alignment,
boolean wrap)
Writes specified text with specified font, alignment, and wrap setting on this PdfDocument 's current page. |
void |
writeText(String str,
PdfFont f,
int alignment,
boolean wrap,
String pageRange)
Writes specified text with specified font, alignment and wrap setting on pages in specified page range. |
void |
writeText(String str,
PdfFont f,
int alignment,
double x,
double y)
Writes specified text with specified font and alignment at position ( x , y ) on this
PdfDocument 's current page. |
void |
writeText(String str,
PdfFont f,
int alignment,
double x,
double y,
boolean wrap)
Writes specified text with specified font, alignment, and wrapping at position ( x , y ) on
this PdfDocument 's current page. |
void |
writeText(String str,
PdfFont f,
int alignment,
double x,
double y,
boolean wrap,
String pageRange)
Writes specified text with specified font, alignment, and wrapping at position ( x , y ) on
pages in specified page range. |
void |
writeText(String str,
PdfFont f,
int alignment,
double x,
double y,
String pageRange)
Writes specified text with specified font and alignment at position ( x , y ) on pages in
specified page range. |
void |
writeText(String str,
PdfFont f,
int alignment,
PdfPoint pt)
Writes specified text with specified font and alignment at specified point on this PdfDocument 's current
page. |
void |
writeText(String str,
PdfFont f,
int alignment,
PdfPoint pt,
boolean wrap)
Writes specified text with specified font, alignment, and wrap setting at specified point on this PdfDocument 's
current page. |
void |
writeText(String str,
PdfFont f,
int alignment,
PdfPoint pt,
boolean wrap,
String pageRange)
Writes specified text with specified font, alignment, and wrap setting at specified point on pages in specified page range. |
void |
writeText(String str,
PdfFont f,
int alignment,
PdfPoint pt,
String pageRange)
Writes specified text with specified font and alignment at specified point on pages in specified page range. |
void |
writeText(String str,
PdfFont f,
int alignment,
String pageRange)
Writes specified text with specified font and alignment on pages in specified page range. |
void |
writeText(String str,
PdfFont f,
PdfPoint pt)
Writes specified text with specified font at specified point on this PdfDocument 's current page. |
void |
writeText(String str,
PdfFont f,
PdfPoint pt,
boolean wrap)
Writes text str with specified font and wrap
setting at specified point on this PdfDocument 's
current page. |
void |
writeText(String str,
PdfFont f,
PdfPoint pt,
boolean wrap,
String pageRange)
Writes text str with specified font and wrap
setting at specified point on pages in specified page range. |
void |
writeText(String str,
PdfFont f,
PdfPoint pt,
double rotation)
Writes text str rotated by rotation
degrees with specified font at specified point on this
PdfDocument 's current page. |
void |
writeText(String str,
PdfFont f,
PdfPoint pt,
double rotation,
String pageRange)
Writes text str rotated by rotation
degrees with specified font at specified point on pages in
specified page range. |
void |
writeText(String str,
PdfFont f,
PdfPoint pt,
String pageRange)
Writes specified text with specified font at specified point on pages in specified page range. |
void |
writeText(String str,
PdfFont f,
PdfRect rectangle)
Writes specified text with specified font inside specified rectangle on this PdfDocument 's current page. |
void |
writeText(String str,
PdfFont f,
PdfRect rectangle,
double rotation,
double firstLinePosition)
Writes specified text rotated by rotation
degrees with specified font and first-line position inside
specified rectangle on this PdfDocument 's
current page. |
void |
writeText(String str,
PdfFont f,
PdfRect rectangle,
double rotation,
double firstLinePosition,
String pageRange)
Writes specified text rotated by rotation
degrees with specified font and first-line position inside
specified rectangle on pages in specified page range. |
void |
writeText(String str,
PdfFont f,
PdfRect rectangle,
int alignment)
Writes specified text with specified alignment and font inside specified rectangle on this PdfDocument 's
current page. |
void |
writeText(String str,
PdfFont f,
PdfRect rectangle,
int alignment,
double rotation,
double firstLinePosition)
Writes specified text rotated by rotation
degrees with specified alignment, first-line position, and
font inside specified rectangle on this
PdfDocument 's current page. |
void |
writeText(String str,
PdfFont f,
PdfRect rectangle,
int alignment,
double rotation,
double firstLinePosition,
String pageRange)
Writes specified text rotated by rotation
degrees with specified alignment, first-line position, and
font inside specified rectangle on pages in specified page
range. |
void |
writeText(String str,
PdfFont f,
PdfRect rectangle,
int alignment,
String pageRange)
Writes specified text with specified font and alignment inside specified rectangle on pages in specified page range. |
void |
writeText(String str,
PdfFont f,
PdfRect rectangle,
String pageRange)
Writes specified text with specified font inside specified rectangle on pages in specified page range. |
void |
writeText(String str,
PdfFont f,
String pageRange)
Writes specified text with specified font on pages in specified page range. |
void |
writeText(String str,
PdfPoint pt)
Writes specified text at specified point on this PdfDocument 's current page. |
void |
writeText(String str,
PdfPoint pt,
boolean wrap)
Writes text str with specified wrap setting at
point pt on this PdfDocument 's
current page. |
void |
writeText(String str,
PdfPoint pt,
boolean wrap,
String pageRange)
Writes text str with specified wrap setting at
point pt on pages in specified page range. |
void |
writeText(String str,
PdfPoint pt,
double rotation)
Writes text str , rotated by rotation
degrees, at point pt on this
PdfDocument 's current page. |
void |
writeText(String str,
PdfPoint pt,
double rotation,
String pageRange)
Writes text str , rotated rotation
degrees, at point pt on pages in specified page
range. |
void |
writeText(String str,
PdfPoint pt,
int alignment,
boolean wrap)
Writes text str with specified alignment and wrap
setting at point pt on this
PdfDocument 's current page. |
void |
writeText(String str,
PdfPoint pt,
int alignment,
boolean wrap,
String pageRange)
Writes text str with specified alignment and
wrap setting at point pt on pages in specified
page range. |
void |
writeText(String str,
PdfPoint pt,
String pageRange)
Writes specified text at specified point on pages in specified page range. |
void |
writeText(String str,
PdfRect rectangle)
Writes specified text inside specified rectangle on this PdfDocument 's current page. |
void |
writeText(String str,
PdfRect rectangle,
double rotation,
double firstLinePosition)
Writes specified text rotated by rotation
degrees with specified first-line position inside specified
rectangle on this PdfDocument 's current page. |
void |
writeText(String str,
PdfRect rectangle,
double rotation,
double firstLinePosition,
String pageRange)
Writes specified text rotated by rotation
degrees with specified first-line position inside specified
rectangle on pages in specified page range. |
void |
writeText(String str,
PdfRect rectangle,
int alignment)
Writes specified text with specfied text alignment on this PdfDocument 's current page. |
void |
writeText(String str,
PdfRect rectangle,
int alignment,
double rotation,
double firstLinePosition)
Writes specified text rotated by rotation
degrees with specified first-line position inside specified
rectangle on this PdfDocument 's current page. |
void |
writeText(String str,
PdfRect rectangle,
int alignment,
double rotation,
double firstLinePosition,
String pageRange)
Writes specified text rotated by rotation
degrees with specified alignment and first-line position inside
specified rectangle on pages in specified page range. |
void |
writeText(String str,
PdfRect rectangle,
int alignment,
String pageRange)
Writes specified text with specified alignment inside specified rectangle on pages in specified page range. |
void |
writeText(String str,
PdfRect rectangle,
String pageRange)
Writes specified text inside specified rectangle on pages in specified page range. |
void |
writeText(String str,
Point pt,
int alignment)
Writes specified text at position pt on current
page with specified text alignment. |
void |
writeText(String str,
Point pt,
int alignment,
String pageRange)
Writes specified text at position pt with
specified text alignment on all pages of a specified page
range. |
void |
writeText(String str,
String pageRange)
Writes specified text at current position on pages in specified page range. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int ALIGNMENT_LEFT
public static final int ALIGNMENT_CENTER
public static final int ALIGNMENT_RIGHT
public static final String VERSION_1_4
public static final String VERSION_1_5
public static final String VERSION_1_6
public static final int MERGE_INCLUDE_ANNOTATIONS
PdfStdDocument.merge(String)
,
Constant Field Valuespublic static final int MERGE_INCLUDE_BOOKMARKS
PdfStdDocument.merge(String)
,
Constant Field Valuespublic static final int MERGE_INCLUDE_DOCUMENT_ACTIONS
PdfStdDocument.merge(String)
,
Constant Field Valuespublic static final int MERGE_INCLUDE_PAGE_ACTIONS
PdfStdDocument.merge(String)
,
Constant Field Valuespublic static final int MERGE_INCLUDE_FORMFIELDS
PdfStdDocument.merge(String)
,
Constant Field Valuespublic static final int MERGE_INCLUDE_ALL
PdfStdDocument.merge(String)
,
Constant Field Valuespublic boolean autoPaginate
Constructor Detail |
public PdfDocument(PdfWriter w) throws PdfException
PdfDocument
object with a
PdfWriter
object. The new PdfDocument
object is used to create a new PDF file - creation mode.
w
- PdfWriter
with which the
PdfProDocument
object needs to be
created
PdfException
- if an illegal argument is supplied.public PdfDocument(PdfReader r) throws IOException, PdfException
PdfDocument
with a
PdfReader
object. The new PdfDocument
object is used to read/modify an existing file - reading mode.
r
- PdfReader
with which the
PdfProDocument
object needs to be
created
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.Method Detail |
public int getViewerPreferences()
PdfPreferences
,
PdfProDocument.setViewerPreferences(int)
public void setViewerPreferences(int value)
value
- constants specifying viewer application preferenecesPdfPreferences
,
PdfProDocument.getViewerPreferences()
public void addTable(PdfTable table, double x, double y, int pageNo) throws PdfException, IOException
table
- table that needs to be renderedx
- x-coordinate of the location on the page where
top-left corner of the table needs to bey
- y-coordinate of the location on the page where
top-left corner of the table needs to bepageNo
- page where the table needs to be rendered
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.public void addTable(PdfTable table, double x, double y, int pageNo, PdfFont f) throws PdfException, IOException
table
- table that needs to be renderedx
- x-coordinate of the location on the page where
top-left corner of the table needs to bey
- y-coordinate of the location on the page where
top-left corner of the table needs to bepageNo
- page where the table needs to be renderedf
- font with which the table needs to be rendered
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.public void stitch(int stitchToPageNo, int stitchFromPageNo, double offsetX, double offsetY) throws PdfException, IOException
stitchToPageNo
- number of the page on which contents from the page
stitchFromPageNo
need to be overlaidstitchFromPageNo
- number of the page whose contents should be overlaid
on page specified by stitchToPageNo
offsetX
- x-coordinate of the position on page
stitchToPageNo
where the top-left
corner of the contents of page
stitchFromPageNo
should be overlaidoffsetY
- y-coordinate of the position on page
stitchToPageNo
where the top-left
corner of the contents of page
stitchFromPageNo
should be overlaid
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.public void attachDocument(String fileName)
fileName
- pathname of the filePdfProDocument.getAttachments()
public void embedFont(PdfFont fontToBeEmbedded) throws PdfException, IOException
PdfFont
object is created using the PdfFont.EMBED_FULL
setting.
fontToBeEmbedded
- font that needs to be embedded
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.PdfFont.create(String, int, int, byte)
,
PdfFont.create(String, int, int, int, byte)
public void embedFont(PdfFont fontToBeEmbedded, String originalFont) throws IOException, PdfException
PdfFont.EMBED_FULL
setting. Specify the original font
by its base name.
fontToBeEmbedded
- font that needs to be embedded in the documentoriginalFont
- base name of the font that needs to be replaced
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.PdfFont.create(String, int, int, byte)
,
PdfFont.create(String, int, int, int, byte)
,
PdfProDocument.getAllFontBaseNames()
,
PdfProDocument.getAllFontBaseNames(String)
public ArrayList getAttachments() throws IOException, PdfException
ByteBuffer
objects representing file attachments
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfProDocument.attachDocument(String)
public void addThumbnailImage(String path, int pageNo) throws IOException, PdfException
path
- pathname of the thumbnail imagepageNo
- number of the page in the document
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfProDocument.removeThumbnailImage(String)
public void removeThumbnailImage(String pageRange) throws PdfException
pageRange
- pages for which there ought to be no thumbnails
PdfException
- if an illegal argument is supplied.PdfProDocument.addThumbnailImage(String, int)
public void addAnnotation(PdfAnnot annotation, int pageNo) throws PdfException
annotation
- new annotation that needs to be addedpageNo
- number of the page to which the annotation needs to
be added
PdfException
- if an illegal argument is supplied.public void addAnnotationList(List annotList, int pageNo) throws PdfException
annotList
- list of new annotations that need to be addedpageNo
- number of the page to which the annotations need to
be added
PdfException
- if an illegal argument is supplied.public void addAnnotationList(List annotList, int pageNo, boolean removeExistingAnnots) throws PdfException
annotList
- list of new annotations that need to be addedpageNo
- number of the page to which the annotations need to
be addedremoveExistingAnnots
- whether to remove or keep existing annotations in
the page
PdfException
- if an illegal argument is supplied.public void addAnnotationList(List annotList, String[] pageRanges, boolean removeExistingAnnots, int measurementUnit) throws PdfException
annotList
- list of new annotations that need to be addedpageRanges
- page range in whose pages the annotations need to be
addedremoveExistingAnnots
- whether to remove or keep existing annotations in
the pagemeasurementUnit
- constant specifying the measurement unit that needs
to be applied for the annotations
PdfException
- if an illegal argument is supplied.PdfMeasurement
public void addAnnotationList(List annotList, String[] pageRanges, int measurementUnit) throws PdfException
annotList
- list of new annotations that need to be addedpageRanges
- pages where the annotations need to be addedmeasurementUnit
- constant specifying the measurement unit that needs
to be applied for the annotations
PdfException
- if an illegal argument is supplied.public void addDefaultFormFont(PdfFont font)
public void addDefaultFormFontList(List fontList)
public void addFormField(PdfFormField formField, int pageNo) throws PdfException
formField
- form field that needs to be addedpageNo
- number of the page to which the form field needs to
be added
PdfException
- if an illegal argument is supplied.public void addFormField(PdfFormField f, String[] pageRanges) throws PdfException
f
- form field (radio button group or check box group)
whose children need to be addedpageRanges
- page ranges to which children form fields need to be
added
PdfException
- if an illegal argument is supplied.public void addFormFieldList(List formFieldList, int pageNo) throws PdfException
formFieldList
- list of form fields that need to be added to the
pagepageNo
- number of the page to which the form fields need to
be added
PdfException
- if an illegal argument is supplied.public void deleteFormFields() throws IOException, PdfException
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void deleteFormFields(int type) throws IOException, PdfException
type
- constant specifying the form field type
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void deleteFormFields(String name) throws IOException, PdfException
name
- name of the form fields
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void deleteFormFieldsOnPage(int pageNo) throws IOException, PdfException
pageNo
- number of the page
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void deleteFormFieldsOnPage(int pageNo, int type) throws IOException, PdfException
pageNo
- number of the pagetype
- form field type
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void deleteFormFieldsOnPage(int pageNo, String name) throws IOException, PdfException
pageNo
- number of the pagename
- name of the form fields
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void exportToFDF(File fdfFile) throws IOException, PdfException
fdfFile
- FDF file to which interactive forms data needs to be
written
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfProDocument.importFromFDF(File)
public void flattenFormFields() throws IOException, PdfException
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void flattenFormFields(boolean flattenWithNewValue) throws IOException, PdfException
flattenWithNewValue
- whether to retain new values. If false
,
form fields will be flattened with their original
values.
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void flattenFormFields(int type) throws IOException, PdfException
type
- constant specifying form field type
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfFormField
public void flattenFormFields(int type, boolean flattenWithNewValue) throws IOException, PdfException
type
- constant specifying form field typeflattenWithNewValue
- whether to retain new values. If false
,
form fields will be flattened with their original
values.
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfFormField
public void flattenFormFields(String name) throws IOException, PdfException
name
- name of the form fields
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void flattenFormFields(String name, boolean flattenWithNewValue) throws IOException, PdfException
name
- name of the form fieldsflattenWithNewValue
- whether to retain new values. If false
,
form fields will be flattened with their original
values.
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void flattenFormFieldsOnPage(int pageNo) throws IOException, PdfException
pageNo
- number of the page
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void flattenFormFieldsOnPage(int pageNo, boolean flattenWithNewValue) throws IOException, PdfException
pageNo
- number of the pageflattenWithNewValue
- whether to retain new values. If false
,
form fields will be flattened with their original
values.
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void flattenFormFieldsOnPage(int pageNo, int type) throws IOException, PdfException
pageNo
- number of the pagetype
- constant specifying form field type
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfFormField
public void flattenFormFieldsOnPage(int pageNo, int type, boolean flattenWithNewValue) throws IOException, PdfException
pageNo
- number of the pagetype
- constant specifying form field typeflattenWithNewValue
- whether to retain new values. If false
,
form fields will be flattened with their original
values.
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfFormField
public void flattenFormFieldsOnPage(int pageNo, String name) throws IOException, PdfException
pageNo
- number of the pagename
- name of the form fields
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void flattenFormFieldsOnPage(int pageNo, String name, boolean flattenWithNewValue) throws IOException, PdfException
pageNo
- number of the pagename
- name of the form fieldsflattenWithNewValue
- whether to retain new values. If false
,
form fields will be flattened with their original
values.
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public List getAllAnnotations() throws IOException, PdfException
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public List getAllAnnotations(int type) throws IOException, PdfException
type
- constant specifying annotation type
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfAnnot
public void getAllAnnotations(int type, List listToPopulate) throws IOException, PdfException
type
- constant specifying the type of annotationslistToPopulate
- list that needs to be populated
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void getAllAnnotations(List listToPopulate) throws IOException, PdfException
listToPopulate
- list that needs to be populated
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public List getAllAnnotationsOnPage(int pageNo) throws PdfException, IOException
pageNo
- number of the page
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.public List getAllAnnotationsOnPage(int pageNo, int type) throws PdfException, IOException
pageNo
- number of the pagetype
- constant specifying annotation type
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.PdfAnnot
public void getAllAnnotationsOnPage(int pageNo, int type, List listToPopulate) throws PdfException, IOException
pageNo
- number of the pagetype
- constant specifying annotation typelistToPopulate
- list that needs to be populated
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.PdfAnnot
public void getAllAnnotationsOnPage(int pageNo, List listToPopulate) throws IOException, PdfException
pageNo
- number of the pagelistToPopulate
- list that needs to be populated
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public List getAllFormFields() throws IOException, PdfException
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public List getAllFormFields(int type) throws IOException, PdfException
type
- constant specifying form field type
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfFormField
public List getAllFormFields(String name) throws IOException, PdfException
name
- name specified for the form fields in the document
IOException
- if an illegal argument is supplied.
PdfException
- if an I/O error occurs.public List getAllFormFieldsOnPage(int pageNo) throws IOException, PdfException
pageNo
- number of the page
IOException
- if an illegal argument is supplied.
PdfException
- if an I/O error occurs.public List getAllFormFieldsOnPage(int pageNo, int type) throws IOException, PdfException
pageNo
- number of the pagetype
- constant specifying form field type
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfFormField
public List getAllFormFieldsOnPage(int pageNo, String name) throws IOException, PdfException
pageNo
- number of the pagename
- name of the form field
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public List getAllFontBaseNames() throws PdfException, IOException
embedding a font
in place
of another font already existing in the document.
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.PdfProDocument.embedFont(PdfFont, String)
public List getAllFontBaseNames(String pageRange) throws PdfException, IOException
embedding a font
in place
of another font already existing in the document.
pageRange
- page range from which fonts are identified
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.PdfProDocument.embedFont(PdfFont, String)
public int getDefaultFieldAlignment()
PdfProDocument.setDefaultFieldAlignment(int)
public Color getDefaultFormFontColor()
PdfProDocument.setDefaultFormFontColor(Color)
public List getDefaultFormFontList()
public void importFromFDF(File fileName) throws IOException, PdfException
fileName
- FDF file from which interactive forms data needs to
be imported
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public boolean isAutoAdjustFieldTextHeight()
PdfProDocument.setAutoAdjustFieldTextHeight(boolean)
public boolean isOverrideFieldAppearanceStreams()
PdfProDocument.setOverrideFieldAppearanceStreams(boolean)
public void setAutoAdjustFieldTextHeight(boolean autoAdjustFieldTextHeight)
autoAdjustFieldTextHeight
- whether the size of text inside text box, list box
and combo box form fields needs to be adjustedPdfProDocument.isAutoAdjustFieldTextHeight()
,
PdfFormTextField.setAutoAdjustTextHeight(boolean)
,
PdfFormListBox
,
PdfFormComboBox
public void setDefaultFieldAlignment(int defualtFieldAlignment)
defualtFieldAlignment
- constant specifying default text alignment for form
fieldsPdfProDocument.getDefaultFieldAlignment()
public void setDefaultFormFontColor(Color defaultFormFontColor)
defaultFormFontColor
- default color for form field text in the documentPdfProDocument.getDefaultFormFontColor()
public void setDefaultFormFontIndex(int defaultFormFontIndex)
public void setDefaultFormFontList(List fontList)
public void setOverrideFieldAppearanceStreams(boolean overrideAppearanceStreams)
false
, then form fields may display the text
only when they receive user input focus.
overrideAppearanceStreams
- whether text associated with all form fields in the
document need to be displayed by defaultPdfProDocument.isOverrideFieldAppearanceStreams()
public PdfEncryption getEncryptor()
PdfDocument
.
PdfEncryption
object identifying
the current encryption settings of the documentPdfStdDocument.setEncryptor(PdfEncryption)
public void setEncryptor(PdfEncryption encrypto) throws PdfException
PdfDocument
.
encrypto
- PdfEncryption
specifying the
encryption settings for the document
PdfException
- if an illegal argument is supplied.PdfStdDocument.getEncryptor()
public int getPageMode()
PdfDocument
's
default page mode. This page mode is applied by default when
the document is opened in a viewer application.
PdfStdDocument.setPageMode(int)
,
PdfPageMode
public void setPageMode(int value)
PdfDocument
needs to be opened.
value
- constant specifying page modePdfStdDocument.getPageMode()
,
PdfPageMode
public int getPageLayout()
PdfStdDocument.setPageLayout(int)
,
PdfPageLayout
public void setPageLayout(int value)
value
- constant specifying the page layoutPdfStdDocument.getPageLayout()
,
PdfPageLayout
public void addAction(int actionType, String applicationToLaunch, boolean isPrint, String parameterToApplication) throws IOException, PdfException
actionType
- always PdfAction.LAUNCH
applicationToLaunch
- pathname of the application or the documentisPrint
- whether the document needs to be printed instead of
being openedparameterToApplication
- arguments with which the application needs to be
launched
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void addAction(int actionType, String javascriptOrURI) throws IOException, PdfException
javascriptOrURI
when the document is displayed.
actionType
- constant specifying the type of action that needs
to be executedjavascriptOrURI
- Javascript statement or Uniform Resource Indicator
(URI) that needs to be executed
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfAction.JAVASCRIPT
,
PdfAction.URI
public void addAction(int event, int actionType, String javascript) throws IOException, PdfException
event
- constant specifying the eventactionType
- constant identifying the action as a Javascript
action, that is, PdfAction.JAVASCRIPT
.javascript
- JavaScript script that needs to be executed by the
action
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfAction.PdfEvent
public void addAction(int namedAction)
namedAction |
Viewer Effect |
---|---|
PdfAction.NAMED_FIRSTPAGE |
Navigates to the first page |
PdfAction.NAMED_LASTPAGE |
Navigates to the last page |
PdfAction.NAMED_NEXTPAGE |
Navigates to the next page |
PdfAction.NAMED_PREVPAGE |
Navigates to the previous page |
namedAction
- constant specifying named actionPdfAction
public void addAction(int actionType, int pageNum) throws IOException, PdfException
actionType
- constant that identifies the action as a go-to
action, that is, PdfAction.GOTO
.pageNum
- number of the page to which the viewer should
navigate when the document is opened
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfAction
public void setTitle(String s)
s
- "title" document property for this documentpublic String getTitle()
PdfStdDocument.setTitle(String)
public void setAuthor(String s)
s
- "author" document property for this documentPdfStdDocument.getAuthor()
public String getAuthor()
PdfStdDocument.setAuthor(String)
public void setSubject(String s)
s
- "subject" document property for this documentpublic String getSubject()
PdfStdDocument.setSubject(String)
public void setKeywords(String s)
s
- "keywords" document property for this documentpublic String getKeywords()
PdfStdDocument.setKeywords(String)
public void setProducer(String s)
s
- producer entry to be used in the document
information dictionaryPdfStdDocument.getProducer()
public String getProducer()
PdfStdDocument.setProducer(String)
public Date getCreationDate()
public Date getModifiedDate()
public long write() throws IOException, PdfException
PdfDocument
to
the PdfDocument
's output stream or file and
returns number of bytes that was saved.
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public int getMeasurementUnit()
PdfDocument
.
PdfStdDocument.setMeasurementUnit(int)
,
PdfMeasurement
public void setMeasurementUnit(int measurementUnit)
PdfDocument
.
measurementUnit
- constant specifying the new default measurement unitPdfStdDocument.getMeasurementUnit()
,
PdfMeasurement
public int getCompressionLevel()
Pdfdocument
.
PdfStdDocument.setCompressionLevel(int)
,
PdfFlateFilter
public void setCompressionLevel(int compressionLevel)
PdfDocument
.
compressionLevel
- constant specifying the compression levelPdfStdDocument.getCompressionLevel()
,
PdfFlateFilter
public String getVersion()
PdfDocument
's
PDF version.
public void setVersion(String version)
PdfDocument
.
version
- constant specifying PDF versionpublic void setWriter(PdfWriter w) throws PdfException
PdfWriter
object to be used with this
PdfDocument
.
w
- PdfWriter
object to be used with this
PdfDocument
PdfException
- if an illegal argument is supplied.PdfStdDocument.getWriter()
,
PdfStdDocument.setReader(PdfReader)
,
PdfStdDocument.getReader()
public void setReader(PdfReader r) throws IOException, PdfException
PdfReader
object to be used with this
PdfDocument
.
r
- PdfReader
object to be used with this
PdfDocument
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfStdDocument.getReader()
,
PdfStdDocument.getWriter()
,
PdfStdDocument.setWriter(PdfWriter)
public PdfReader getReader()
PdfReader
object currently used with
this PdfDocument
.
PdfReader
object currently used with the
PdfDocument
; null
if the
PdfDocument
is used with a
PdfWriter
objectPdfStdDocument.setReader(PdfReader)
,
PdfStdDocument.getReader()
,
PdfStdDocument.setReader(PdfReader)
public PdfWriter getWriter()
PdfWriter
object currently used with
this PdfDocument
.
PdfWriter
object currently used with the
PdfDocument
; null
if the
PdfDocument
is used with a
PdfReader
objectPdfStdDocument.setWriter(PdfWriter)
,
PdfStdDocument.getReader()
,
PdfStdDocument.setReader(PdfReader)
public File getWriterOutputFile()
public PdfPage getPage(int pageNo) throws PdfException
PdfPage
object specified by page number
in this document.
pageNo
- page number in the document
PdfPage
object
PdfException
- if an illegal argument is supplied.public int getPageCount()
PdfDocument
.
public void setPenWidth(double width)
PdfDocument
's
pen.
width
- default width for the PdfDocument
's
penpublic void setPenColor(Color color)
PdfDocument
's
pen.
color
- default color for the PdfDocument
's
penpublic void setPenDashLength(double length)
PdfDocument
's pen.
length
- length of dashes in the default dash patternPdfStdDocument.setPenDashGap(double)
,
PdfStdDocument.setPenDashPhase(double)
public void setPenDashGap(double gap)
PdfDocument
's pen.
gap
- length of gaps in the default dash patternPdfStdDocument.setPenDashLength(double)
,
PdfStdDocument.setPenDashPhase(double)
public void setPenDashPhase(double phase)
PdfDocument
's pen.
phase
- length of phase of the default dash patternPdfStdDocument.setPenDashGap(double)
,
PdfStdDocument.setPenDashLength(double)
public void setPenCapStyle(int capStyle)
PdfDocument
.
capStyle
- constant specifying the default shapePdfPen
,
PdfStdDocument.setPenJoinStyle(int)
public void setPenJoinStyle(int joinStyle)
PdfDocument
's
pen.
joinStyle
- constant specifying the default shapePdfPen
,
PdfStdDocument.setPenCapStyle(int)
public void setPenMiterLimit(int limit)
PdfDocument
's pen.
limit
- default miter limit for the
PdfDocument
's penPdfPen
public void setBrushColor(Color c)
PdfDocument
's
brush.
c
- default color for the PdfDocument
's
brushpublic String getXMLMetadata() throws IOException, PdfException
PdfDocument
.
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void disableAllMargins(String pageRange) throws PdfException
pageRange
- page range on whose pages margins need to disabled
PdfException
- if an illegal argument is supplied.PdfStdDocument.enableAllMargins(String)
public void enableAllMargins(String pageRange) throws PdfException
pageRange
- page range on whose pages margins need to enabled
PdfException
- if an illegal argument is supplied.PdfStdDocument.enableAllMargins(String)
public boolean isOpenAfterSave()
PdfStdDocument.setOpenAfterSave(boolean)
public void setOpenAfterSave(boolean openAfterSave)
™
) after it is saved to a file.
This method is currently supported only in Windows OSs.
openAfterSave
- whether document needs to be executed after data is
saved to filePdfStdDocument.isOpenAfterSave()
,
PdfStdDocument.setPrintAfterSave(boolean)
public void addToFiltersList(int filter)
Multiple filters can be added to the list of filters for a single document. Filters will be applied in the order they were added.
filter
- filter to be addedPdfFilter
public void setPrintAfterSave(boolean printAfterSave)
™
Operating Systems.
printAfterSave
- whether the document needs to be printed after it is
saved to a filePdfStdDocument.setOpenAfterSave(boolean)
public void appendPagesFrom(PdfDocument d, String pageRange) throws IOException, PdfException
d
- document from which pages need to be appendedpageRange
- pages that need to be appended
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfFormFieldRenameHandler
,
PdfStdDocument.setOnRenameField(PdfFormFieldRenameHandler)
public void appendPagesFrom(String path, String pageRange) throws IOException, PdfException
path
- document from which pages need to be appendedpageRange
- pages that need to be appended
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfFormFieldRenameHandler
,
PdfStdDocument.setOnRenameField(PdfFormFieldRenameHandler)
public void insertPagesFrom(com.gnostice.pdfone.PdfStdDocument d, String pageRange, int insertAfterPage) throws IOException, PdfException
d
- document from which pages need to be insertedpageRange
- pages that need to be inserted from the documentinsertAfterPage
- page position in this document where pages
from the other document needs to be inserted
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfFormFieldRenameHandler
,
PdfStdDocument.setOnRenameField(PdfFormFieldRenameHandler)
public void insertPagesFrom(String path, String pageRange, int insertAfterPage) throws IOException, PdfException
path
- pathname of the document from which pages need to be
insertedpageRange
- pages that need to be inserted from the documentinsertAfterPage
- page position in this document where pages
from the other document needs to be inserted
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfFormFieldRenameHandler
,
PdfStdDocument.setOnRenameField(PdfFormFieldRenameHandler)
public void merge(List docList) throws IOException, PdfException
PdfDocument
objects
or pathnames of the documents.
docList
- list containing documents that need to be merged
with this document
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfFormFieldRenameHandler
,
PdfStdDocument.setOnRenameField(PdfFormFieldRenameHandler)
public void merge(List docList, int mergeOptions) throws IOException, PdfException
PdfDocument
objects or pathnames of the
documents.
docList
- list containing documents that need to be merged
with this documentmergeOptions
- combination of flags (constants) used for merging
documents
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfFormFieldRenameHandler
,
PdfStdDocument.setOnRenameField(PdfFormFieldRenameHandler)
public void merge(PdfDocument d) throws IOException, PdfException
d
- document that needs to be merged with this
document
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfFormFieldRenameHandler
,
PdfStdDocument.setOnRenameField(PdfFormFieldRenameHandler)
public void merge(PdfDocument d, int mergeOptions) throws IOException, PdfException
d
- document that needs to be merged with this
documentmergeOptions
- combination of flags (constants) used for merging
documents
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfFormFieldRenameHandler
,
PdfStdDocument.setOnRenameField(PdfFormFieldRenameHandler)
public void merge(String path) throws IOException, PdfException
path
- pathname of the other document that needs to be
merged with this document
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfFormFieldRenameHandler
,
PdfStdDocument.setOnRenameField(PdfFormFieldRenameHandler)
public void merge(String path, int mergeOptions) throws IOException, PdfException
path
- pathname of the other document that needs to be
merged with this documentmergeOptions
- combination of flags (constants) used for merging
documents
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfFormFieldRenameHandler
,
PdfStdDocument.setOnRenameField(PdfFormFieldRenameHandler)
public void setOnBookmarkMerge(PdfBookmarkMergeHandler onBookmarkMerge)
onBookmarkMerge()
event.
public void setOnRenameField(PdfFormFieldRenameHandler pfrh)
onRenameField()
event.
pfrh
- object that implements
PdfFormFieldRenameHandler
interfacepublic void deletePages(String pageRange) throws PdfException
PdfDocument
.
pageRange
- page range from which pages need to be deleted
PdfException
- if an illegal argument is supplied.public void extractPagesTo(String path, String pageRange) throws IOException, PdfException
path
- pathname of the file to which the pages are to be
addedpageRange
- page range whose pages are to be extracted
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfFormFieldRenameHandler
,
PdfStdDocument.setOnRenameField(PdfFormFieldRenameHandler)
public void extractPagesTo(String path, String pageRange, String extractAsVersion, boolean openAfterExtraction) throws IOException, PdfException
path
- pathname of the file to which the pages are to be
addedpageRange
- page range whose pages are to be extractedextractAsVersion
- PDF version in which pages are extracted and saved
to the new fileopenAfterExtraction
- whether the output file is to be opened after it is
written to
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfFormFieldRenameHandler
,
PdfStdDocument.setOnRenameField(PdfFormFieldRenameHandler)
public void split(String pageRange) throws IOException, PdfException
Specifying pageRange
as "1-10" on a
12-page document will create a new document 1-10.pdf
containing all pages from 1 to 10.
The name of the new document can be obtained and changed at
run time using the
onNeedFileName()
event.
pageRange
- pages that need to be extracted
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfStdDocument.setOnNeedFileName(PdfNeedFileNameHandler)
public void split(int pages) throws IOException, PdfException
Calling split(5)
on a 12-page document will
create three new PDF documents, named 1-5.pdf,
6-10.pdf, and 11-13.pdf. The file 1-5.pdf
will contain pages 1 to 5 of the original document. The file
6-10.pdf will contain pages 6 to 10 of the original
document. The file 11-12.pdf will contain pages 11 to 12
of the original document.
Names for the new documents can be obtained and changed at
run time using the
onNeedFileName()
event.
pages
- number of consecutive pages that need to be
extracted for each new document
IOException
- if an I/O error occurs
PdfException
- if an illegal argument is supplied.PdfStdDocument.setOnNeedFileName(PdfNeedFileNameHandler)
public void setOnNeedFileName(PdfNeedFileNameHandler pnfnh)
onNeedFileName()
event.
pnfnh
- object that implements
PdfNeedFileNameHandler
interfacePdfStdDocument.split(int)
,
PdfStdDocument.split(String)
public void addWatermarkImage(PdfImage image, int position, boolean applyPageMargins, double angle, boolean underlay, String pageRange) throws IOException, PdfException
PdfImage
object as watermark with its exact
position determined by position
and
applyPageMargins
.
Constants defined in PdfPage
can be used to align the
image inside the watermark.
The image is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
image
- PdfImage
object that needs to be used
as the watermark imageposition
- constant specifying the combination of vertical and
horizontal alignment of the imageapplyPageMargins
- whether page margins need to be considered when
positioning the imageangle
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the image with reference to
center of its bounding boxunderlay
- whether the image needs to be placed underneath
other page contentspageRange
- page range on whose pages the image needs to be
applied as the watermark
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void addWatermarkImage(PdfImage image, int position, double angle, boolean underlay, String pageRange) throws IOException, PdfException
PdfImage
object as watermark on pages in
specified page range.
Constants defined in PdfPage
can be used to align
the image inside the watermark.
The image is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
image
- PdfImage
object that needs to be used
as the watermark imageposition
- constant specifying the combination of vertical and
horizontal alignment of the imageangle
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the image with reference to
center of its bounding boxunderlay
- whether the image needs to be placed underneath
other page contentspageRange
- page range on whose pages the image needs to be
applied as the watermark
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void addWatermarkImage(String path, int position, boolean applyPageMargins, double angle, boolean underlay, String pageRange) throws IOException, PdfException
position
and
applyPageMargins
on pages in specified page
range.
Constants defined in PdfPage
can be used to
align the image inside the watermark.
The image is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
path
- pathname of the watermark imageposition
- constant specifying the combination of vertical and
horizontal alignment of the imageapplyPageMargins
- whether page margins need to be considered when
positioning the imageangle
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the image with reference to
center of its bounding boxunderlay
- whether the image needs to be placed underneath
other page contentspageRange
- page range on whose pages the image needs to be
applied as the watermark
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void addWatermarkImage(String path, int position, double angle, boolean underlay, String pageRange) throws IOException, PdfException
Constants defined in PdfPage
can be used to align the
image inside the watermark.
The image is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
path
- pathname of the watermark imageposition
- constant specifying the combination of vertical and
horizontal alignment of the imageangle
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the image with reference to
center of its bounding boxunderlay
- whether the image needs to be placed underneath
other page contentspageRange
- page range on whose pages the image needs to be
applied as the watermark
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void addWatermarkText(String text, PdfFont font, int position, boolean applyPageMargins, double angle, boolean underlay, String pageRange) throws IOException, PdfException
position
and
applyPageMargins
on pages in specified page
range.
Constants defined in PdfPage
can be used to align the
text inside the watermark.
The text is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
text
- text that needs to be added as the watermarkfont
- font with which the watermark needs to be writtenposition
- constant specifying the combination of vertical and
horizontal alignment of the textapplyPageMargins
- whether page margins need to be considered when
positioning the textangle
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the text with reference to
center of its bounding boxunderlay
- whether the text needs to be placed underneath other
page contentspageRange
- page range on whose pages the text needs to be
applied as the watermark
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void addWatermarkText(String text, PdfFont font, int position, double angle, boolean underlay, String pageRange) throws IOException, PdfException
Constants defined in PdfPage
can be used to align the
text inside the watermark.
The text is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
text
- text to be displayed as watermarkfont
- font with which the watermark needs to be writtenposition
- constant specifying the combination of vertical and
horizontal alignment of the textangle
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the text with reference to
center of its bounding boxunderlay
- whether the text needs to be placed underneath
other page contentspageRange
- page range on whose pages the text needs to be
applied as the watermark
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void addWatermarkText(String text, PdfFont font, PdfRect rect, int alignment, int firstLinePosition, int position, double angle, boolean underlay, String pageRange) throws IOException, PdfException
text
- text that needs to be used as watermarkfont
- font with which the watermark text needs to be renderedrect
- rectangular area inside which the watermark needs to
be renderedalignment
- constant
specifying text
alignmentfirstLinePosition
- starting position of the first line of the watermark
textposition
- constant specifying the combination of vertical and
horizontal alignment of the textangle
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the text with reference to
center of its bounding boxunderlay
- whether the text needs to be placed underneath other
page contentspageRange
- pages where the watermark need to be added
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public PdfBookmark addBookmark(int namedAction, String title, PdfBookmark parent)
parent
)
with specified title, and sets the bookmark to perform
specified named action.
namedAction
- action to be be performed when bookmark is selectedtitle
- text that needs to be used to display the bookmarkparent
- bookmark under which the new bookmark is to be
created
parent
public PdfBookmark addBookmark(String title, PdfBookmark parent, int pageNo) throws PdfException
parent
)
with specified title, and sets the bookmark to lead to
specified page.
title
- text that needs to be used to display the bookmarkparent
- bookmark under which the new bookmark is to be
createdpageNo
- number of the page that is to be displayed when
bookmark is selected
parent
PdfException
- if an illegal argument is supplied.public PdfBookmark addBookmark(String title, PdfBookmark parent, int pageNo, double left, double top, double zoom) throws PdfException
parent
)
with specified title, and sets the bookmark to lead to
specified location on specified page with specified zoom.
title
- text that needs to be used to display the bookmarkparent
- bookmark under which the new bookmark is to be
createdpageNo
- number of the page that is to be displayed when
bookmark is selectedleft
- offset of the position from (0, top) (expressed in
points)top
- offset of the position from (left, 0) (expressed in
points)zoom
- zoom factor to be applied when displaying the page
parent
PdfException
- if an illegal argument is supplied.public PdfBookmark addBookmark(String title, PdfBookmark parent, int pageNo, double x, double y, double width, double height) throws PdfException
parent
),
and sets the bookmark's
destination
to a rectangular area with specified top-left
corner (x
, y
), width and
height.
title
- text that needs to be used to display the bookmarkparent
- bookmark under which the new bookmark is to be
createdpageNo
- number of the page that needs to be displayed when
bookmark is selected by the userx
- x-coordinate of the top-left corner of the
rectangular areay
- y-coordinate of the top-left corner of the
rectangular areawidth
- width of the rectangular areaheight
- height of the rectangular area
parent
PdfException
- if an illegal argument is supplied.public PdfBookmark addBookmark(String title, PdfBookmark parent, int pageNo, double pos, int fit) throws PdfException
parent
),
and sets the bookmark's destination specified by
pageNo
, pos
and fit
.
fit |
pos |
Page Display |
---|---|---|
PdfBookmark.FITH |
vertical coordinate of destination |
|
PdfBookmark.FITBH |
vertical coordinate of destination |
|
PdfBookmark.FITBV |
horizontal coordinate of destination |
|
PdfBookmark.FITV |
horizontal coordinate of destination |
|
title
- text that needs to be used to display the bookmarkparent
- bookmark under which the new bookmark is to be
createdpageNo
- number of the page that is to be displayed when
bookmark is selectedpos
- horizontal or vertical coordinate of the bookmark's
destinationfit
- constant determining how page is displayed inside
window
parent
PdfException
- if an illegal argument is supplied.public PdfBookmark addBookmark(String title, PdfBookmark parent, int pageNo, int fit) throws PdfException
parent
)
with specified title, and sets the bookmark's destination
specified by pageNo
and fit
.
title
- text that needs to be used to display the bookmarkparent
- bookmark under which the new bookmark is to be
createdpageNo
- number of the page that is to be displayed when
bookmark is selectedfit
- constant determining how page is displayed inside
window (Always is PdfBookmark.FITB
)
parent
PdfException
- if an illegal argument is supplied.public PdfBookmark addBookmark(String title, PdfBookmark parent, int pageNo, PdfRect rect) throws PdfException
parent
)
with specified title and sets the bookmark to lead to
specified rectanglular area on specified page.
title
- text that needs to be used to display the bookmarkparent
- bookmark under which the new bookmark is to be
createdpageNo
- number of the page that is to be displayed when
bookmark is selectedrect
- rectangle on the specified page
parent
PdfException
- if an illegal argument is supplied.public PdfBookmark addBookmark(String title, PdfBookmark parent, int pageNo, Rectangle rect) throws PdfException
parent
)
with specified title, and sets the bookmark to lead to
specified rectangular area on specified page.
title
- text that needs to be used to display the bookmarkparent
- bookmark under which the new bookmark is to be
createdpageNo
- number of the page that is to be displayed when
bookmark is selectedrect
- rectangular area on the specified page
parent
PdfException
- if an illegal argument is supplied.public PdfBookmark addBookmark(String title, PdfBookmark parent, String applicationToLaunch, boolean print) throws PdfException
parent
), and
sets it to launch a specified application or print a specified
file. If print
is true
, then the
file applicationToLaunch
will be printed by the
viewer using the file type's default application. If
print
is false
, then file
applicationToLaunch
will be considered as an
aplication and launched by the viewer using the Operating
Sytem's (OS') default shell program.
title
- text that needs to be used to display the bookmarkparent
- bookmark below which the new bookmark needs to be
createdapplicationToLaunch
- application that needs to be launched (if
print
were false) or the file that
needs to be printed (if print
was
true)print
- whether the file applicationToLaunch
needs to be printed
parent
PdfException
- if an illegal argument is supplied.public PdfBookmark addBookmark(String title, PdfBookmark parent, String javascriptOrURI, int actionType) throws PdfException
parent
) and
sets it execute a Javascript script or resolve a URI (Uniform
Resource Identifier).
title
- text that needs to be used to display the bookmarkparent
- bookmark below which the new bookmark needs to be
createdjavascriptOrURI
- Javascript script that needs to be executed or the
URI that needs to be resolvedactionType
- constant identifying the action as a Javascript
action (PdfAction.JAVASCRIPT
) or a URI
action (PdfAction.URI
)
parent
PdfException
- if an illegal argument is supplied.public PdfBookmark addBookmark(String title, PdfBookmark parent, String pdfFileName, int pageNo, boolean newWindow) throws PdfException
parent
),
and sets it to open a specified page on a specified PDF
document in the same window or a new window of the viewer.
title
- text that needs to be used to display the bookmarkparent
- bookmark below which the new bookmark needs to be
createdpdfFileName
- pathname of the PDF document that needs to be openedpageNo
- number of the page in the PDF documentnewWindow
- whether to open the PDF document in a new window. If
set to false
, the document is opened
in the same window.
parent
PdfException
- if an illegal argument is supplied.public PdfBookmark getBookmarkRoot() throws PdfException
PdfBookmark
object that points to the
root of the bookmark tree of this PdfDocument
.
Should be used only if the PdfDocument
was
created with a PdfWriter
object.
The root is at the top of the hierarchy that contains
bookmarks displayed in the document outline. The
PdfBookmark.getFirstChild()
method can be used on
the PdfBookmark
returned by
getBookmarkRoot()
to navigate to the first
bookmark in the document outline.
PdfBookmark
object that points to the
root of the bookmark tree
PdfException
- An illegal argument was suppliedPdfStdDocument.getFirstBookmark()
,
PdfStdDocument.removeBookmarkRoot()
public void removeBookmarkRoot()
PdfStdDocument.getBookmarkRoot()
,
PdfStdDocument.getFirstBookmark()
public PdfBookmark getFirstBookmark() throws PdfException
PdfDocument
's
document outline. Should be used only if the
PdfDocument
was created with a
PdfReader
object.
PdfBookmark
object of the first
bookmark in the document outline
PdfException
- if an illegal argument is supplied.PdfStdDocument.getBookmarkRoot()
,
PdfStdDocument.removeBookmarkRoot()
public void add(PdfPage p) throws PdfException
PdfPage
to this
PdfDocument
.
It is not recommended that a PdfPage
object is
added to the same document or to multiple documents more than
once. If at all necessary, it is better to clone the
PdfPage
object as many times.
p
- PdfPage
to be added
PdfException
- if an illegal argument is supplied.public void add(PdfPage p, boolean setAsCurrentPage) throws PdfException
PdfPage
to this
PdfDocument
and, if
setAsCurrentPage
is true, sets the
PdfPage
as the PdfDocument
's
current page.
By default, the first page that is added to a
PdfDocument
is the default current page. If some
content has been written directly to a
PdfDocument
that is without first adding a page,
then a default page is automatically added to it and becomes
its current page.
p
- PdfPage
to be addedsetAsCurrentPage
- whether the PdfPage
should be set as
the current page
PdfException
- if an illegal argument is supplied.public void addFooterImage(PdfImage img, int position, boolean underlay, String pageRange) throws IOException, PdfException
PdfImage
object to footer of pages in
specified page range.
Constants defined in PdfPage
can be used to align
the image inside the footer.
img
- PdfImage
object to be used in the
footerposition
- constant specifying combination of vertical and
horizontal alignment of the image within the footerunderlay
- whether the image needs to be placed underneath
other page elementspageRange
- page range on whose pages the image is to be added
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void addFooterImage(String path, int position, boolean underlay, String pageRange) throws IOException, PdfException
Constants defined in PdfPage
can be used to align the
image inside the footer.
path
- pathname of the imageposition
- constant specifying combination of vertical and
horizontal alignment of the image within the footerunderlay
- whether the image needs to be placed underneath
other content in the footerpageRange
- page range on whose pages the image is to be added
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void addFooterText(String text, PdfFont font, int position, boolean underlay, String pageRange) throws IOException, PdfException
Constants defined in PdfPage
can be used to align the
text inside the footer.
text
- text to be added to the footerfont
- font with which the text next needs to be writtenposition
- constant specifying the combination of vertical and
horizontal alignment of the text within the footerunderlay
- whether the text needs to be placed underneath other
content in the footerpageRange
- page range on whose pages the text is to be added
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void addFooterText(String text, PdfFont font, PdfRect rect, int alignment, int firstLinePosition, int position, boolean underlay, String pageRange) throws IOException, PdfException
text
- text that needs to be added as the footerfont
- font with which the text next needs to be writtenrect
- rectangular area where the footer needs to be
renderedalignment
- constant
specifying text
alignmentfirstLinePosition
- starting position of the first line of the header
textposition
- constant
specifying the combination
of vertical and horizontal alignment of the textunderlay
- whether the footer needs to be placed underneath
other page elementspageRange
- pages on which the header needs to be rendered
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void addHeaderImage(PdfImage img, int position, boolean underlay, String pageRange) throws IOException, PdfException
PdfImage
object to header of pages in
specified page range.
Constants defined in PdfPage
can be used to align the image inside the header.
img
- PdfImage
object that needs to be
added to the headerposition
- constant specifying the combination of vertical and
horizontal alignment of the image within the headerunderlay
- whether the image needs to be placed underneath
other content in the headerpageRange
- page range on whose pages the image is to be added
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void addHeaderImage(String path, int position, boolean underlay, String pageRange) throws IOException, PdfException
Constants defined in PdfPage
can be used to align the
image inside the header.
path
- pathname of the imageposition
- constant specifying combination of vertical and
horizontal alignment of the image within the headerunderlay
- whether the image needs to be placed underneath
other content in the headerpageRange
- page range on whose pages the image is to be added
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void addHeaderText(String text, PdfFont font, int position, boolean underlay, String pageRange) throws IOException, PdfException
Constants defined in PdfPage
can be used to
align the text inside the watermark.
text
- text to be added to headerfont
- font with which the text next needs to be writtenposition
- combination of vertical and horizontal alignmentunderlay
- whether the text needs to be placed underneath
other content in the headerpageRange
- page range on whose pages the text is to be added
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void addHeaderText(String text, PdfFont font, PdfRect rect, int alignment, int firstLinePosition, int position, boolean underlay, String pageRange) throws IOException, PdfException
text
- text that needs to be used as a headerfont
- font with which the header text is renderedrect
- rectangular area inside which the header needs to be
renderedalignment
- constant
specifying text
alignmentfirstLinePosition
- starting position of the first line of the header
textposition
- constant
specifying the combination
of vertical and horizontal alignment of the textunderlay
- whether the header needs to be placed underneath
other page elementspageRange
- pages on which the header needs to be rendered
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawArc(PdfRect rect, double startAngle, double arcAngle) throws IOException, PdfException
PdfDocument
. Rectangle rect
represents bounding box of an imaginary circle that completes
the arc. The arc begins at startAngle
degrees and
spans for arcAngle
degrees.
startAngle
is measured in anti-clockwise
direction.
rect
- bounding box of the imaginary circle that completes
the arcstartAngle
- (measured in anti-clockwise direction and expressed
in degrees) angle from which the arc needs to beginarcAngle
- (expressed in degrees) angle for which the arc needs
to span
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawArc(PdfRect rect, double startAngle, double arcAngle, String pageRange) throws IOException, PdfException
rect
represents bounding box of an imaginary
circle that completes the arc. The arc begins at
startAngle
degrees and spans for
arcAngle
degrees. startAngle
is
measured in anti-clockwise direction.
rect
- bounding box of the imaginary circle that completes
the arcstartAngle
- (measured in anti-clockwise direction and expressed
in degrees) angle from which the arc needs to beginarcAngle
- (expressed in degrees) angle for which the arc needs
to spanpageRange
- page page range on whose pages the arc needs to be
drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawBezierCurve(double startX, double startY, double ctrlX, double ctrlY, double endX, double endY, boolean isFill, boolean isStroke) throws IOException, PdfException
PdfDocument
. The curves starts at
(startX
, startY
) and ends at
(endX
, endY
with its control point
being at (ctrlX
, ctrlY
).
startX
- x-coordinate of starting point of the curvestartY
- y-coordinate of starting point of the curvectrlX
- x-coordinate of control point of the curvectrlY
- y-coordinate of control point of the curveendX
- x-coordinate of end point of the curveendY
- y-coordinate of end point of the curveisFill
- whether the curve needs to be filledisStroke
- whether the curve needs to be stroked
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawBezierCurve(double startX, double startY, double ctrlX, double ctrlY, double endX, double endY, boolean isFill, boolean isStroke, String pageRange) throws IOException, PdfException
PdfDocument
. The
curves starts at (startX
, startY
)
and ends at (endX
, endY
with
its control point being at (ctrlX
,
ctrlY
).
startX
- x-coordinate of starting point of the curvestartY
- y-coordinate of starting point of the curvectrlX
- x-coordinate of control point of the curvectrlY
- y-coordinate of control point of the curveendX
- x-coordinate of end point of the curveendY
- y-coordinate of end point of the Bézier curveisFill
- whether the curve needs to be filledisStroke
- whether the curve needs to be strokedpageRange
- page range on whose pages the curve needs to be
drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawBezierCurve(double startX, double startY, double ctrlX1, double ctrlY1, double ctrlX2, double ctrlY2, double endX, double endY, boolean isFill, boolean isStroke) throws IOException, PdfException
PdfDocument
. The curve starts at
(startX
, startY
) and ends at
(endX
, endY
. Its first control point
is at (ctrlX1
, ctrlY1
). Its second
control point is at (ctrlX2
, ctrlY2
).
startX
- x-coordinate of starting point of the curvestartY
- y-coordinate of starting point of the curvectrlX1
- x-coordinate of first control point of the curvectrlY1
- y-coordinate of first control point of the curvectrlX2
- x-coordinate of second control point of the curvectrlY2
- y-coordinate of second control point of the curveendX
- x-coordinate of end point of the curveendY
- y-coordinate of end point of the curveisFill
- whether the curve needs to be filledisStroke
- whether the curve needs to be stroked
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawBezierCurve(double startX, double startY, double ctrlX1, double ctrlY1, double ctrlX2, double ctrlY2, double endX, double endY, boolean isFill, boolean isStroke, String pageRange) throws IOException, PdfException
PdfDocument
. The
curve starts at (startX
, startY
)
and ends at (endX
, endY
. Its
first control point is at (ctrlX1
,
ctrlY1
). Its second control point is at
(ctrlX2
, ctrlY2
).
startX
- x-coordinate of starting point of the curvestartY
- y-coordinate of starting point of the curvectrlX1
- x-coordinate of first control point of the curvectrlY1
- y-coordinate of first control point of the curvectrlX2
- x-coordinate of second control point of the curvectrlY2
- y-coordinate of second control point of the curveendX
- x-coordinate of end point of the curveendY
- y-coordinate of end point of the curveisFill
- whether the curve needs to be filledisStroke
- whether the curve needs to be strokedpageRange
- page range on whose pages the curve needs to be
drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawCircle(double x, double y, double radius, boolean isFill, boolean isStroke) throws IOException, PdfException
PdfDocument
's current page. The circle's center
is positioned at (x
, y
).
x
- x-coordinate of the center of the circley
- y-coordinate of the center of the circleradius
- radius of the circleisFill
- whether the circle needs to be filledisStroke
- whether the circle needs to be stroked
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawCircle(double x, double y, double radius, boolean isFill, boolean isStroke, String pageRange) throws IOException, PdfException
PdfDocument
.
The circle's center is positioned at
(x
, y
).
x
- x-coordinate of the center of the circley
- y-coordinate of the center of the circleradius
- radius of the circleisFill
- whether the circle needs to be filledisStroke
- whether the circle needs to be strokedpageRange
- page range on whose pages the circle will be drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawEllipse(double x1, double y1, double x2, double y2, boolean isFill, boolean isStroke) throws IOException, PdfException
PdfDocument
's current
page. Top-left corner of ellipse's bounding box is specified
by (x1
, y1
). Bottom-right corner of
ellipse's bounding box is specified by
(x2
, y2
).
x1
- x-coordinate of the top-left corner of the ellipse's
bounding boxy1
- y-coordinate of the top-left corner of the ellipse's
bounding boxx2
- x-coordinate of the bottom-right corner of the
ellipse's bounding boxy2
- y-coordinate of the bottom-right corner of the
ellipse's bounding boxisFill
- whether the ellipse needs to be filledisStroke
- whether the ellipse needs to be stroked
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawEllipse(double x1, double y1, double x2, double y2, boolean isFill, boolean isStroke, String pageRange) throws IOException, PdfException
PdfDocument
's current page. Top-left corner of
ellipse's bounding box is specified by (x1
,
y1
). Bottom-right corner of ellipse's bounding
box is specified by (x2
, y2
).
x1
- x-coordinate of the top-left corner of the ellipse's
bounding boxy1
- y-coordinate of the top-left corner of the ellipse's
bounding boxx2
- x-coordinate of the bottom-right corner of the
ellipse's bounding boxy2
- y-coordinate of the bottom-right corner of the
ellipse's bounding boxisFill
- whether the ellipse needs to be filledisStroke
- whether the ellipse needs to be strokedpageRange
- page range on whose pages the ellipse needs to be
drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(PdfImage img, double x, double y) throws IOException, PdfException
x
, y
)
on this PdfDocument
's current page.
img
- image that needs to be drawnx
- x-coordinate of the position where the image needs
to be drawny
- y-coordinate of the position where the image needs
to be drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(PdfImage img, double x, double y, double rotation) throws IOException, PdfException
rotation
degrees at position (x
, y
) on this
PdfDocument
's current page.
The image is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
img
- image that needs to be drawnx
- x-coordinate of the position where the image needs
to be drawny
- y-coordinate of the position where the image needs
to be drawnrotation
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the image with reference to
center of its bounding box
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(PdfImage img, double x, double y, double width, double height) throws IOException, PdfException
x
, y
) with specified height and
width on this PdfDocument
's current page.
img
- image that needs to be drawnx
- x-coordinate of the position where the image needs
to be drawny
- y-coordinate of the position where the image needs
to be drawnwidth
- width of the imageheight
- height of the image
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(PdfImage img, double x, double y, double width, double height, double rotation) throws IOException, PdfException
rotation
degrees
at position (x
, y
) with specified
height and width on this PdfDocument
's current
page.
The image is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
img
- image that needs to be drawnx
- x-coordinate of the position where the image needs
to be drawny
- y-coordinate of the position where the image needs
to be drawnwidth
- width of the imageheight
- height of the imagerotation
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the image with reference to
center of its bounding box
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(PdfImage img, double x, double y, double width, double height, double rotation, String pageRange) throws IOException, PdfException
rotation
degrees
at position (x
, y
) with specified
height and width on pages in specified page range.
The image is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
img
- image that needs to be drawnx
- x-coordinate of the position where the image needs
to be drawny
- y-coordinate of the position where the image needs
to be drawnwidth
- width of the imageheight
- height of the imagerotation
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the image with reference to
center of its bounding boxpageRange
- page range on whose pages the image needs to be
drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(PdfImage img, double x, double y, double width, double height, String pageRange) throws IOException, PdfException
x
, y
) with specified height and
width on pages in specified page range.
img
- image that needs to be drawnx
- x-coordinate of the position where the image needs
to be drawny
- y-coordinate of the position where the image needs
to be drawnwidth
- width of the imageheight
- height of the imagepageRange
- page range on whose pages the image needs to be
drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(PdfImage img, double x, double y, double rotation, String pageRange) throws IOException, PdfException
rotation
degrees
at position (x
, y
) on pages in
specified page range.
The image is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
img
- image that needs to be drawnx
- x-coordinate of the position where the image needs
to be drawny
- y-coordinate of the position where the image needs
to be drawnrotation
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the image with reference to
center of its bounding boxpageRange
- page range on whose pages the image needs to be
drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(PdfImage img, double x, double y, String pageRange) throws IOException, PdfException
x
, y
) on pages in specified page
range.
img
- image that needs to be drawnx
- x-coordinate of the position where the image needs
to be drawny
- y-coordinate of the position where the image needs
to be drawnpageRange
- page range on whose pages the image needs to be
drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(PdfImage img, PdfPoint pt) throws IOException, PdfException
PdfDocument
's current page.
img
- image that needs to be drawnpt
- point where the image needs to be drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(PdfImage img, PdfPoint pt, double rotation) throws IOException, PdfException
rotation
degrees
at specified point on this PdfDocument
's current
page.
The image is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
img
- image that needs to be drawnpt
- point where the image needs to be drawnrotation
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the image with reference to
center of its bounding box
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(PdfImage img, PdfPoint pt, double width, double height) throws IOException, PdfException
PdfDocument
's current page.
img
- image that needs to be drawnpt
- point where the image needs to be drawnwidth
- width of the imageheight
- height of the image
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(PdfImage img, PdfPoint pt, double width, double height, double rotation) throws IOException, PdfException
rotation
degrees at specified point on this PdfDocument
's
current page.
The image is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
img
- image that needs to be drawnpt
- point where the image needs to be drawnwidth
- width of the imageheight
- height of the imagerotation
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the image with reference to
center of its bounding box
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(PdfImage img, PdfPoint pt, double width, double height, double rotation, String pageRange) throws IOException, PdfException
rotation
degrees
at specified point with specified width and height on pages in
the specified page range.
The image is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
img
- image that needs to be drawnpt
- point where the image needs to be drawnwidth
- width of the imageheight
- height of the imagerotation
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the image with reference to
center of its bounding boxpageRange
- page range on whose pages the image needs to be
drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(PdfImage img, PdfPoint pt, double width, double height, String pageRange) throws IOException, PdfException
img
- image that needs to be drawnpt
- point where the image needs to be drawnwidth
- width of the imageheight
- width of the imagepageRange
- page range on whose pages the image needs to be
drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(PdfImage img, PdfPoint pt, double rotation, String pageRange) throws IOException, PdfException
rotation
degrees
at specified point on pages in the specified page range.
The image is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
img
- image that needs to be drawnpt
- point where the image needs to be drawnrotation
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the image with reference to
center of its bounding boxpageRange
- page range on whose pages the image needs to be
drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(PdfImage img, PdfPoint pt, String pageRange) throws IOException, PdfException
img
- image that needs to be drawnpt
- point where the image needs to be drawnpageRange
- page range on whose pages the image needs to be
drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(PdfImage img, PdfRect rect) throws IOException, PdfException
PdfDocument
's current page.
img
- image that needs to be drawnrect
- PdfRectangle
object inside which the
image needs to be drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(PdfImage img, PdfRect rect, double rotation) throws IOException, PdfException
rotation
degrees
inside specified rectangle on this PdfDocument
's
current page.
The image is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
img
- image that needs to be drawnrect
- rectangle on which the image needs to be drawnrotation
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the image with reference to
center of its bounding box
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(PdfImage img, PdfRect rect, double rotation, String pageRange) throws IOException, PdfException
rotation
degrees
inside specified rectangle on pages in specified range.
The image is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
img
- image that needs to be drawnrect
- PdfRect
object of the rectangle inside
which the image is to be drawnrotation
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the image with reference to
center of its bounding boxpageRange
- page range on whose pages the image is to be
drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(PdfImage img, PdfRect rect, String pageRange) throws IOException, PdfException
img
- image that needs to be drawnrect
- rectangle on which the image needs to be drawnpageRange
- page range on whose pages the image needs to be
drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(String path, double x, double y) throws IOException, PdfException
x
, y
) on this
PdfDocument
's current page.
path
- pathname of the image filex
- x-coordinate of the position where the image
needs to be drawny
- y-coordinate of the position where the image
needs to be drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(String path, double x, double y, double rotation) throws IOException, PdfException
rotation
degrees at position
(x
, y
) on this
PdfDocument
's current page.
The image is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
path
- pathname of the image filex
- x-coordinate of the position where the image needs
to be drawny
- y-coordinate of the position where the image needs
to be drawnrotation
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the image with reference to
center of its bounding box
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(String path, double x, double y, double width, double height) throws IOException, PdfException
PdfDocument
's current page.
path
- pathname of the image filex
- x-coordinate of the position where the image needs
to be drawny
- y-coordinate of the position where the image needs
to be drawnwidth
- width of the imageheight
- height of the image
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(String path, double x, double y, double width, double height, double rotation) throws IOException, PdfException
rotation
degrees at position
(x
, y
) with specified width and
height on this PdfDocument
's current page.
The image is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
path
- pathname of the image filex
- x-coordinate of the position where the image needs
to be drawny
- y-coordinate of the position where the image needs
to be drawnwidth
- width of the imageheight
- height of the imagerotation
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the image with reference to
center of its bounding box
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(String path, double x, double y, double width, double height, double rotation, String pageRange) throws IOException, PdfException
rotation
degrees at position
(x
, y
) with specified width and
height on pages in specified page range.
The image is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
path
- pathname of the image filex
- x-coordinate of the position where the image needs
to be drawny
- y-coordinate of the position where the image needs
to be drawnwidth
- width of the imageheight
- height of the imagerotation
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the image with reference to
center of its bounding boxpageRange
- page range on whose pages the image needs to be
drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(String path, double x, double y, double width, double height, String pageRange) throws IOException, PdfException
x
, y
)with specified width and
height on pages in specified page range.
path
- pathname of the image filex
- x-coordinate of the position where the image needs
to be drawny
- y-coordinate of the position where the image needs
to be drawnwidth
- width of the imageheight
- height of the imagepageRange
- page range on whose pages the image needs to be
drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(String path, double x, double y, double rotation, String pageRange) throws IOException, PdfException
rotation
degrees at position (x
,
y
)on pages in specified range.
The image is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
path
- pathname of the image filex
- x-coordinate of the position where the image needs
to be drawny
- y-coordinate of the position where the image needs
to be drawnrotation
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the image with reference to
center of its bounding boxpageRange
- page range on whose pages the image needs to be
drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(String path, double x, double y, String pageRange) throws IOException, PdfException
x
, y
) on pages in specified page
range.
path
- pathname of the image filex
- x-coordinate of the position where the image needs
to be drawny
- y-coordinate of the position where the image needs
to be drawnpageRange
- page range on whose pages the image needs to be
drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(String path, PdfPoint pt) throws IOException, PdfException
PdfDocument
's current page.
path
- pathname of the image filept
- point where the image needs to be drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(String path, PdfPoint pt, double rotation) throws IOException, PdfException
rotation
degrees at specified point on this
PdfDocument
's current page.
The image is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
path
- pathname of the image filept
- point where the image needs to be drawnrotation
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the image with reference to
center of its bounding box
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(String path, PdfPoint pt, double width, double height) throws IOException, PdfException
PdfDocument
's
current page.
path
- pathname of the image filept
- point where the image needs to be drawnwidth
- width of the imageheight
- height of the image
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(String path, PdfPoint pt, double width, double height, double rotation) throws IOException, PdfException
rotation
degrees at specified point with
specified width and height on this PdfDocument
's
current page.
The image is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
path
- pathname of the image filept
- point where the image needs to be drawnwidth
- width of the imageheight
- height of the imagerotation
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the image with reference to
center of its bounding box
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(String path, PdfPoint pt, double width, double height, double rotation, String pageRange) throws IOException, PdfException
rotation
degrees at specified position with
specified width and height on pages in specified page range.
The image is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
path
- pathname of the image filept
- point where the image needs to be drawnwidth
- width of the imageheight
- height of the imagerotation
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the image with reference to
center of its bounding boxpageRange
- page range on whose pages the image needs to be
drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(String path, PdfPoint pt, double width, double height, String pageRange) throws IOException, PdfException
path
- pathname of the image filept
- point where the image needs to be drawnwidth
- width of the imageheight
- height of the imagepageRange
- page range on whose pages the image needs to be
drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(String path, PdfPoint pt, double rotation, String pageRange) throws IOException, PdfException
rotation
degrees at specified point on pages in
specified range.
The image is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
path
- pathname of the image filept
- point where the image needs to be drawnrotation
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the image with reference to
center of its bounding boxpageRange
- page range on whose pages the image needs to be
drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(String path, PdfPoint pt, String pageRange) throws IOException, PdfException
path
- pathname of the image filept
- point where the image needs to be drawnpageRange
- page range on whose pages the image needs to be
drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(String path, PdfRect rect) throws IOException, PdfException
PdfDocument
's current page.
path
- pathname of the image filerect
- rectangle inside which the image needs to be drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(String path, PdfRect rect, double rotation) throws IOException, PdfException
rotation
degrees inside specified rectangle on
this PdfDocument
's current page.
The image is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
path
- pathname of the image filerect
- rectangle inside which the image needs to be drawnrotation
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the image with reference to
center of its bounding box
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(String path, PdfRect rect, double rotation, String pageRange) throws IOException, PdfException
rotation
degrees inside specified rectangle on
pages in specified page range.
The image is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
path
- pathname of the image filerect
- rectangle inside which the image needs to be drawnrotation
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the image with reference to
center of its bounding boxpageRange
- page range on whose pages the image needs to be
drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawImage(String path, PdfRect rect, String pageRange) throws IOException, PdfException
path
- pathname of the image filerect
- rectangle inside which the image needs to be drawnpageRange
- page range on whose pages the image needs to be
drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawLine(double startx, double starty, double endx, double endy) throws IOException, PdfException
startx
, starty
) and
(endx
, endy
) on this
PdfDocument
's current page.
startx
- x-coordinate of the position from which the line
needs to be drawnstarty
- y-coordinate of the position from which the line
needs to be drawnendx
- x-coordinate of the position to which the line
needs to be drawnendy
- y-coordinate of the position to which the line
needs to be drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawLine(double startx, double starty, double endx, double endy, String pageRange) throws IOException, PdfException
startx
,
starty
) and (endx
,
endy
) on pages in specified page range.
startx
- x-coordinate of the position from which the line
needs to be drawnstarty
- y-coordinate of the position from which the line
needs to be drawnendx
- x-coordinate of the position to which the line
needs to be drawnendy
- y-coordinate of the position to which the line
needs to be drawnpageRange
- page range on whose pages the line needs to be
drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawLine(PdfPoint start, PdfPoint end) throws IOException, PdfException
start
to end
on this PdfDocument
's current page.
start
- starting point of the lineend
- end point of the line
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawLine(PdfPoint start, PdfPoint end, String pageRange) throws IOException, PdfException
start
to end
on
pages in specified page range.
start
- starting point of the lineend
- end point of the linepageRange
- page range on whose pages the line needs to be
drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawPie(double x, double y, double width, double height, double startAngle, double arcAngle, boolean isFill, boolean isStroke, String pageRange) throws IOException, PdfException
x
, y
) represents the
top-left corner of the bounding box of an imaginary ellipse,
which the pie segment can neatly fit into.
x
- x-coordinate of top-left corner of the bounding box
of the imaginary ellipse that contains the pie
segmenty
- y-coordinate of top-left corner of the bounding box
of the imaginary ellipse that contains the pie
segmentwidth
- width of the bounding box of the imaginary ellipse
that contains the pie segmentheight
- height of the bounding box of the imaginary pie of
which the pie segment can be an integral partstartAngle
- (measured in anti-clockwise direction and expressed
in degrees) angle from which the pie segment needs
to startarcAngle
- (expressed in degrees) angle for which the pie
segment needs to spanisFill
- whether the pie segment needs to be filledisStroke
- whether the pie segment needs to be strokedpageRange
- page page range on whose pages the pie segment needs
to be drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawPie(int x, int y, int width, int height, double startAngle, double arcAngle, boolean isFill, boolean isStroke) throws IOException, PdfException
PdfDocument
's
current page. The position (x
, y
)
represents the top-left corner of the bounding box of an
imaginary ellipse, which the pie segment can neatly fit into.
x
- x-coordinate of top-left corner of the bounding box
of the imaginary ellipse that contains the pie
segmenty
- y-coordinate of top-left corner of the bounding box
of the imaginary ellipse that contains the pie
segmentwidth
- width of the bounding box of the imaginary ellipse
that contains the pie segmentheight
- height of the bounding box of the imaginary ellipse
that contains the pie segmentstartAngle
- (measured in anti-clockwise direction and expressed
in degrees) angle from which the pie segment needs
to startarcAngle
- (expressed in degrees) angle for which the pie
segment needs to spanisFill
- whether the pie segment needs to be filledisStroke
- whether the pie segment needs to be stroked
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawPolygon(double[] xPoints, double[] yPoints, int nPoints, boolean isFill, boolean isStroke) throws IOException, PdfException
PdfDocument
's current
page. Arrays xPoints
and
yPoints
contain x- and y-coordinates of
certain specific points on the page. nPoints
represents the number of these points, starting with the
first, that need to be connected to draw the polygon.
xPoints
- array containing x-coordinates of certain specific
points on the pageyPoints
- array containing y-coordinates of certain specific
points on the pagenPoints
- number of points that need to be connected together,
starting with the first of those points represented
by xPoints
and yPoints
,
to draw the polygonisFill
- whether the polygon needs to be filledisStroke
- whether the polygon needs to be stroked
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawPolygon(double[] xPoints, double[] yPoints, int nPoints, boolean isFill, boolean isStroke, String pageRange) throws IOException, PdfException
xPoints
and yPoints
contain
x- and y-coordinates of certain specific points on the
page. nPoints
represents the number of these
points, starting with the first, that need to be connected
to draw the polygon.
xPoints
- array containing x-coordinates of certain specific
points on pages in specified page rangeyPoints
- array containing y-coordinates of certain specific
points on pages in specified page rangenPoints
- number of points that need to be connected together,
starting with the first of those points represented
by xPoints
and yPoints
,
to draw the polygonisFill
- whether the polygon nees to be filledisStroke
- whether the polygon needs to be strokedpageRange
- page range on whose pages the polygon needs to be
drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawPolyline(double[] xPoints, double[] yPoints, int nPoints) throws IOException, PdfException
PdfDocument
's current
page. Arrays xPoints
and yPoints
contain x- and y-coordinates of certain specific points on the
page. nPoints
represents the number of these
points, starting with the first, that need to be connected to
draw the polyline.
xPoints
- array containing x-coordinates of certain specific
points on the pageyPoints
- array containing y-coordinates of certain specific
points on the pagenPoints
- number of points that need to be connected together,
starting with the first of those points represented
by xPoints
and yPoints
,
to draw the polyline
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawPolyline(double[] xPoints, double[] yPoints, int nPoints, String pageRange) throws IOException, PdfException
xPoints
and yPoints
contain x-
and y-coordinates of certain specific points on the page.
nPoints
represents the number of these points,
starting with the first, that need to be connected to draw
the polyline.
xPoints
- array containing x-coordinates of certain specific
points on pages in specified page rnageyPoints
- array containing y-coordinates of certain specific
points on pages in specified page rnagenPoints
- number of points that need to be connected together,
starting with the first of those points represented
by xPoints
and yPoints
,
to draw the polylinepageRange
- page range on whose pages the polyline needs to be
drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawRect(double x, double y, double width, double height) throws IOException, PdfException
x
,
y
) with specified width
and
height
on this PdfDocument
's
current page.
x
- x-coordinate of top-left corner of the rectangley
- y-coordinate of top-left corner of the rectanglewidth
- width of the rectangleheight
- height of the rectangle
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawRect(double x, double y, double width, double height, boolean isFill, boolean isStroke) throws IOException, PdfException
PdfDocument
's current
page at position (x
, y
) with
specified width
, height
, pen,
and brush settings.
x
- x-coordinate of top-left corner of the rectangley
- y-coordinate of top-left corner of the rectanglewidth
- width of the rectangleheight
- height of the rectangleisFill
- whether the rectangle needs to be filledisStroke
- whether the rectangle needs to be stroked
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawRect(double x, double y, double width, double height, boolean isFill, boolean isStroke, String pageRange) throws IOException, PdfException
x
, y
) with specified
width
, height
, brush, and pen
settings.
x
- x-coordinate of top-left corner of the rectangley
- y-coordinate of top-left corner of the rectanglewidth
- width of the rectangleheight
- height of the rectangleisFill
- whether the rectangle needs to be filledisStroke
- whether the rectangle needs to be strokedpageRange
- page range on whose pages the rectangle needs to be
drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawRect(double x, double y, double width, double height, String pageRange) throws IOException, PdfException
x
,
y
) with specified width
and
height
on pages in specified page range.
x
- x-coordinate of top-left corner of the rectangley
- y-coordinate of top-left corner of the rectanglewidth
- width of the rectangleheight
- height of the rectanglepageRange
- page range on whose pages the rectangle needs to be
drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawRect(PdfRect r) throws IOException, PdfException
r
on this
PdfDocument
's current page.
r
- rectangle that needs to be drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawRect(PdfRect r, String pageRange) throws IOException, PdfException
PdfRect
object on pages in
specified page range.
r
- PdfRect
object which needs to be
drawnpageRange
- page range on whose pages the rectangle needs to be
drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawRect(Rectangle r) throws IOException, PdfException
Rectangle
object on this
PdfDocument
's current page.
r
- Rectangle
object, which needs to
be drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawRect(Rectangle r, String pageRange) throws IOException, PdfException
Rectangle
object on pages in
specified page range.
r
- Rectangle
object, which needs to be
drawnpageRange
- page range on whose pages the rectangle needs to be
drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawRoundRect(double x, double y, double width, double height, double arcWidth, double arcHeight, boolean isFill, boolean isStroke) throws IOException, PdfException
PdfDocument
's current page. The corners of the
rectangle are actually arcs whose dimensions are specified by
arcWidth
and arcHeight
. The
dimensions of the whole rectangle are specified by
width
and height
.
x
- x-coordinate of top-left corner of the rectangley
- y-coordinate of top-left corner of the rectanglewidth
- width of the rectangleheight
- height of the rectanglearcWidth
- width of the rounded cornersarcHeight
- height of the rounded cornersisFill
- whether the rectangle needs to be filledisStroke
- whether the rectangle needs to be stroked
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawRoundRect(double x, double y, double width, double height, double arcWidth, double arcHeight, boolean isFill, boolean isStroke, String pageRange) throws IOException, PdfException
arcWidth
and
arcHeight
. The dimensions of the whole
rectangle are specified by width
and
height
.
x
- x-coordinate of top-left corner of the rectangley
- y-coordinate of top-left corner of the rectanglewidth
- width of the rectangleheight
- height of the rectanglearcWidth
- width of the rounded cornersarcHeight
- height of the rounded cornersisFill
- whether the rectangle needs to be filledisStroke
- whether the rectangle needs to be strokedpageRange
- page range on whose pages the rectangle needs to be
drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawSquare(double x, double y, double length) throws IOException, PdfException
PdfDocument
's current
page.
x
- x-coordinate of the top-left corner of the squarey
- y-coordinate of the top-left corner of the squarelength
- length of a side of the square
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawSquare(double x, double y, double length, boolean isFill, boolean isStroke) throws IOException, PdfException
PdfDocument
's current page.
x
- x-coordinate of the top-left corner of the squarey
- y-coordinate of the top-left corner of the squarelength
- length of a side of the squareisFill
- whether the square needs to be filledisStroke
- whether the square needs to be stroked
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawSquare(double x, double y, double length, boolean isFill, boolean isStroke, String pageRange) throws IOException, PdfException
x
- x-coordinate of the top-left corner of the squarey
- y-coordinate of the top-left corner of the squarelength
- length of a side of the squareisFill
- whether the square needs to be filledisStroke
- whether the square needs to be strokedpageRange
- page range on whose pages the square needs to be
drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void drawSquare(double x, double y, double length, String pageRange) throws IOException, PdfException
x
- x-coordinate of the top-left corner of the squarey
- y-coordinate of the top-left corner of the squarelength
- length of a side of the squarepageRange
- page range on whose pages the square needs to be
drawn
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void writeText(String str) throws PdfException, IOException
PdfDocument
's current page.
str
- text that needs to be written
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.public void writeText(String str, boolean wrap) throws PdfException, IOException
PdfDocument
's current
page.
str
- text that needs to be writtenwrap
- constant specifying whether the text needs to be
wrapped
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.PdfTextFormatter
public void writeText(String str, boolean wrap, String pageRange) throws PdfException, IOException
str
- text that needs to be writtenwrap
- constant specifying whether the text needs to be
wrapped at the marginspageRange
- page range on whose pages the text needs to be
written
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.PdfTextFormatter
public void writeText(String str, double x, double y) throws PdfException, IOException
x
,
y
) on this PdfDocument
's
current page.
str
- text that needs to be writtenx
- x-coordinate of the position where the text needs to
be writteny
- y-coordinate of the position where the text needs to
be written
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.public void writeText(String str, double x, double y, boolean wrap) throws PdfException, IOException
x
, y
) on this
PdfDocument
's current page.
str
- text that needs to be writtenx
- x-coordinate of the position where the text needsy
- y-coordinate of the position where the text needs to
be writtenwrap
- constant specifying whether the text needs to be
wrapped
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.PdfTextFormatter
public void writeText(String str, double x, double y, boolean wrap, String pageRange) throws PdfException, IOException
x
, y
) on pages in
specified page range.
str
- text that needs to be writtenx
- x-coordinate of the position where the text needs
to be writteny
- y-coordinate of the position where the text needs
to be writtenwrap
- constant specifying whether the text needs to be
wrappedpageRange
- page range on whose pages the text needs to be
written
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.PdfTextFormatter
public void writeText(String str, double x, double y, double rotation) throws IOException, PdfException
rotation
degrees
at position (x
, y
) on this
PdfDocument
's current page.
The text is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
str
- text that needs to be writtenx
- x-coordinate of the position where the text needs to
be writteny
- y-coordinate of the position where the text needs to
be writtenrotation
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the text with reference to
center of its bounding box
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void writeText(String str, double x, double y, double rotation, String pageRange) throws IOException, PdfException
rotation
degrees at position (x
, y
) on
pages in specified page range.
The text is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
str
- text that needs to be writtenx
- x-coordinate of the position where the text needs to
be writteny
- y-coordinate of the position where the text needs to
be writtenrotation
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the text with reference to
center of its bounding boxpageRange
- page range on whose pages the text needs to be
written
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void writeText(String str, double x, double y, int alignment) throws PdfException, IOException
x
, y
) on this
PdfDocument
's current page.
str
- text that needs to be writtenx
- x-coordinate of the position where the text needs to
be writteny
- y-coordinate of the position where the text needs to
be writtenalignment
- constant specifying how the text needs to be
aligned
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.PdfTextFormatter
public void writeText(String str, double x, double y, int alignment, boolean wrap) throws IOException, PdfException
x
, y
)
on this PdfDocument
's current page.
str
- text that needs to be writtenx
- x-coordinate of the position where the text needs
to be writteny
- y-coordinate of the position where the text needs
to be writtenalignment
- constant specifying how the text needs to be
alignedwrap
- constant specifying whether the text needs to be
wrapped
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfTextFormatter
public void writeText(String str, double x, double y, int alignment, boolean wrap, String pageRange) throws IOException, PdfException
x
, y
)
on pages in specified page range.
str
- text that needs to be writtenx
- x-coordinate of the position where the text needs
to be writteny
- y-coordinate of the position where the text needs
to be writtenalignment
- constant specifying how the text needs to be
alignedwrap
- constant specifying whether the text needs to be
wrappedpageRange
- page range on whose pages the text needs to be
written
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfTextFormatter
public void writeText(String str, double x, double y, int alignment, String pageRange) throws PdfException, IOException
x
, y
) on pages in
specified range.
str
- text that needs to be writtenx
- x-coordinate of the position where the text needs to
be writteny
- y-coordinate of the position where the text needs to
be writtenalignment
- constant specifying how the text needs to be
alignedpageRange
- page range on whose pages the text needs to be
written
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.PdfTextFormatter
public void writeText(String str, double x, double y, String pageRange) throws PdfException, IOException
x
, y
)
on pages in specified page range.
str
- text that needs to be writtenx
- x-coordinate of the position where the text needs to
be writteny
- y-coordinate of the position where the text needs to
be writtenpageRange
- page range on whose pages the text needs to be
written
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.public void writeText(String str, int alignment) throws PdfException, IOException
PdfDocument
's current
page.
str
- text that needs to be writtenalignment
- constant specifying how the text needs to be
aligned
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.PdfTextFormatter
public void writeText(String str, int alignment, boolean wrap) throws PdfException, IOException
PdfDocument
's current page.
str
- text that needs to be writtenalignment
- constant specifying how the text needs to be
alignedwrap
- constant specifying whether the text needs to
be wrapped
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.PdfTextFormatter
public void writeText(String str, int alignment, boolean wrap, String pageRange) throws PdfException, IOException
str
- text that needs to be writtenalignment
- constant specifying how the text needs to be
alignedwrap
- constant specifying whether the text needs to be
wrappedpageRange
- page range on whose pages the text needs to be
written
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.PdfTextFormatter
public void writeText(String str, int alignment, String pageRange) throws PdfException, IOException
str
- text that needs to be writtenalignment
- constant specifying how the text needs to be
alignedpageRange
- page range on whose pages the text needs to be
written
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.PdfTextFormatter
public void writeText(String str, PdfFont f) throws PdfException, IOException
PdfDocument
's current page.
str
- text that needs to be writtenf
- font with which the text needs to be written
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.public void writeText(String str, PdfFont f, boolean wrap) throws PdfException, IOException
PdfDocument
's current page.
str
- text that needs to be writtenf
- font with which the text needs to be writtenwrap
- constant specifying whether the text needs to be
wrapped
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.PdfTextFormatter
public void writeText(String str, PdfFont f, boolean wrap, String pageRange) throws PdfException, IOException
str
- text that needs to be writtenf
- font with which the text needs to be writtenwrap
- constant specifying whether the text needs to be
wrappedpageRange
- page range on whose pages the text needs to be
written
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.PdfTextFormatter
public void writeText(String str, PdfFont f, double x, double y) throws PdfException, IOException
x
, y
) on this
PdfDocument
's current page.
str
- text that needs to be writtenf
- font with which the text needs to be writtenx
- x-coordinate of the position where the text needs
to be writteny
- y-coordinate of the position where the text needs
to be written
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.public void writeText(String str, PdfFont f, double x, double y, boolean wrap) throws IOException, PdfException
x
, y
) on this
PdfDocument
's current page.
str
- text that needs to be writtenf
- font with which the text needs to be writtenx
- x-coordinate of the position where the text needs
to be writteny
- y-coordinate of the position where the text needs
to be writtenwrap
- constant specifying whether the text needs to be
wrapped
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfTextFormatter
public void writeText(String str, PdfFont f, double x, double y, boolean wrap, String pageRange) throws IOException, PdfException
x
, y
) on pages in
specified page range.
str
- text that needs to be writtenf
- font with which the text needs to be writtenx
- x-coordinate of the position where the text needs
to be writteny
- y-coordinate of the position where the text needs
to be writtenwrap
- constant specifying whether the text needs to be
wrappedpageRange
- page range on whose pages the text needs to be
written
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfTextFormatter
public void writeText(String str, PdfFont f, double x, double y, double rotation) throws IOException, PdfException
rotation
degrees with specified font at position (x
,
y
) on this PdfDocument
's
current page.
The text is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
str
- text that needs to be writtenf
- font with which the text needs to be writtenx
- x-coordinate of the position where the text needs
to be writteny
- y-coordinate of the position where the text needs
to be writtenrotation
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the text with reference to
center of its bounding box
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void writeText(String str, PdfFont f, double x, double y, double rotation, String pageRange) throws IOException, PdfException
rotation
degrees with specified font at position (x
,
y
) on pages in specified page range.
The text is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
str
- text that needs to be writtenf
- font with which the text needs to be writtenx
- x-coordinate of the position where the text needs
to be writteny
- y-coordinate of the position where the text needs
to be writtenrotation
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the text with reference to
center of its bounding boxpageRange
- page range on whose pages the text needs to be
written
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void writeText(String str, PdfFont f, double x, double y, String pageRange) throws PdfException, IOException
x
, y
) on pages in
specified page range.
str
- text that needs to be writtenf
- font with which the text needs to be writtenx
- x-coordinate of the position where the text needs
to be writteny
- y-coordinate of the position where the text needs
to be writtenpageRange
- page range on whose pages the text needs to be
written
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.public void writeText(String str, PdfFont f, int alignment) throws PdfException, IOException
PdfDocument
's current page.
str
- text that needs to be writtenf
- font with which the text needs to be writtenalignment
- constant specifying how the text needs to be
aligned
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.PdfTextFormatter
public void writeText(String str, PdfFont f, int alignment, boolean wrap) throws PdfException, IOException
PdfDocument
's current page.
str
- text that needs to be writtenf
- font with which the text needs to be writtenalignment
- constant specifying how the text needs to be
alignedwrap
- constant specifying whether the text needs to be
wrapped
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.PdfTextFormatter
public void writeText(String str, PdfFont f, int alignment, boolean wrap, String pageRange) throws PdfException, IOException
str
- text that needs to be writtenf
- font with which the text needs to be writtenalignment
- constant specifying how the text needs to be
alignedwrap
- constant specifying whether the text needs to be
wrappedpageRange
- page range on whose pages the text needs to be
written
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.PdfTextFormatter
public void writeText(String str, PdfFont f, int alignment, double x, double y) throws IOException, PdfException
x
, y
) on this
PdfDocument
's current page.
str
- text that needs to be writtenf
- font with which the text needs to be writtenalignment
- constant specifying how the text needs to be
alignedx
- x-coordinate of the position where the text needs
to be writteny
- y-coordinate of the position where the text needs
to be written
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfTextFormatter
public void writeText(String str, PdfFont f, int alignment, double x, double y, boolean wrap) throws IOException, PdfException
x
, y
) on
this PdfDocument
's current page.
str
- text that needs to be writtenf
- font with which the text needs to be writtenalignment
- constant specifying how the text needs to be
alignedx
- x-coordinate of the position where the text needs
to be writteny
- y-coordinate of the position where the text needs
to be writtenwrap
- constant specifying whether the text needs to be
wrapped
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfTextFormatter
public void writeText(String str, PdfFont f, int alignment, double x, double y, boolean wrap, String pageRange) throws IOException, PdfException
x
, y
) on
pages in specified page range.
str
- text that needs to be writtenf
- font with which the text needs to be writtenalignment
- constant specifying how the text needs to be
alignedx
- x-coordinate of the position where the text needs
to be writteny
- y-coordinate of the position where the text needs
to be writtenwrap
- constant specifying whether the text needs to be
wrappedpageRange
- page range on whose pages the text needs to be
written
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfTextFormatter
public void writeText(String str, PdfFont f, int alignment, double x, double y, String pageRange) throws IOException, PdfException
x
, y
) on pages in
specified page range.
str
- text that needs to be writtenf
- font with which the text needs to be writtenalignment
- constant specifying how the text needs to be
alignedx
- x-coordinate of the position where the text needs
to be writteny
- y-coordinate of the position where the text needs
to be writtenpageRange
- page range on whose pages the text needs to be
written
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfTextFormatter
public void writeText(String str, PdfFont f, int alignment, PdfPoint pt) throws IOException, PdfException
PdfDocument
's current
page.
str
- text that needs to be writtenf
- font with which the text needs to be writtenalignment
- constant specifying how the text needs to be
alignedpt
- PdfPoint
where the text needs to be
written
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfTextFormatter
public void writeText(String str, PdfFont f, int alignment, PdfPoint pt, boolean wrap) throws IOException, PdfException
PdfDocument
's
current page.
str
- text that needs to be writtenf
- font with which the text needs to be writtenalignment
- constant specifying how the text needs to be
alignedpt
- PdfPoint
where the text needs to be
writtenwrap
- constant specifying whether the text needs to be
wrapped
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfTextFormatter
public void writeText(String str, PdfFont f, int alignment, PdfPoint pt, boolean wrap, String pageRange) throws IOException, PdfException
str
- text that needs to be writtenf
- font with which the text needs to be writtenalignment
- constant specifying how the text needs to be
alignedpt
- PdfPoint
where the text needs to be
writtenwrap
- constant specifying whether the text needs to be
wrappedpageRange
- page range on whose pages the text needs to be
written
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfTextFormatter
public void writeText(String str, PdfFont f, int alignment, PdfPoint pt, String pageRange) throws IOException, PdfException
str
- text that needs to be writtenf
- font with which the text needs to be writtenalignment
- constant specifying how the text needs to be
alignedpt
- PdfPoint
where the text needs to be
writtenpageRange
- page range on whose pages the text needs to be
written
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfTextFormatter
public void writeText(String str, PdfFont f, int alignment, String pageRange) throws PdfException, IOException
str
- text that needs to be writtenf
- font with which the text needs to be writtenalignment
- constant specifying how the text needs to be
alignedpageRange
- page range on whose pages the text needs to be
written
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.PdfTextFormatter
public void writeText(String str, PdfFont f, PdfPoint pt) throws PdfException, IOException
PdfDocument
's current page.
str
- text that needs to be writtenf
- font with which the text needs to be writtenpt
- PdfPoint
where the text needs to be
written
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.public void writeText(String str, PdfFont f, PdfPoint pt, boolean wrap) throws IOException, PdfException
str
with specified font and wrap
setting at specified point on this PdfDocument
's
current page.
str
- text that needs to be writtenf
- font with which the text needs to be writtenpt
- PdfPoint
where the text needs to be
writtenwrap
- constant specifying whether the text needs to be
wrapped
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfTextFormatter
public void writeText(String str, PdfFont f, PdfPoint pt, boolean wrap, String pageRange) throws IOException, PdfException
str
with specified font and wrap
setting at specified point on pages in specified page range.
str
- text that needs to be writtenf
- font with which the text needs to be writtenpt
- PdfPoint
where the text needs to be
writtenwrap
- constant specifying whether the text needs to be
wrappedpageRange
- page range on whose pages the text needs to be
written
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfTextFormatter
public void writeText(String str, PdfFont f, PdfPoint pt, double rotation) throws IOException, PdfException
str
rotated by rotation
degrees with specified font at specified point on this
PdfDocument
's current page.
The text is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
str
- text that needs to be writtenf
- font with which the text needs to be writtenpt
- PdfPoint
where the text needs to be
writtenrotation
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the text with reference to
center of its bounding box
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void writeText(String str, PdfFont f, PdfPoint pt, double rotation, String pageRange) throws IOException, PdfException
str
rotated by rotation
degrees with specified font at specified point on pages in
specified page range.
The text is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
str
- text that needs to be writtenf
- text that needs to be writtenpt
- PdfPoint
where the text needs to be
writtenrotation
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the text with reference to
center of its bounding boxpageRange
- page range on whose pages the text needs to be
written
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void writeText(String str, PdfFont f, PdfPoint pt, String pageRange) throws PdfException, IOException
str
- text that needs to be writtenf
- font with which the text needs to be writtenpt
- PdfPoint
where the text needs to be
writtenpageRange
- page range on whose pages the text needs to be
written
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.public void writeText(String str, PdfFont f, PdfRect rectangle) throws PdfException, IOException
PdfDocument
's current page.
str
- text that needs to be writtenf
- font with which the text needs to be writtenrectangle
- rectangle inside which the text needs to be written
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.public void writeText(String str, PdfFont f, PdfRect rectangle, double rotation, double firstLinePosition) throws IOException, PdfException
rotation
degrees with specified font and first-line position inside
specified rectangle on this PdfDocument
's
current page.
The text is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
str
- text that needs to be writtenf
- font with which the text needs to be writtenrectangle
- rectangle inside which the text needs to be writtenrotation
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the text with reference to
center of its bounding boxfirstLinePosition
- position inside the rectangle where the first line
of text should begin (Applied in current measurement
unit)
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void writeText(String str, PdfFont f, PdfRect rectangle, double rotation, double firstLinePosition, String pageRange) throws IOException, PdfException
rotation
degrees with specified font and first-line position inside
specified rectangle on pages in specified page range.
The text is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
str
- text that needs to be writtenf
- text that needs to be writtenrectangle
- rectangle inside which the text needs to be writtenrotation
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the text with reference to
center of its bounding boxfirstLinePosition
- position inside the rectangle where the first line
of text should begin (Applied in current
measurement unit)pageRange
- page range on whose pages the text needs to be
written
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void writeText(String str, PdfFont f, PdfRect rectangle, int alignment) throws IOException, PdfException
PdfDocument
's
current page.
str
- text that needs to be writtenf
- font with which the text needs to be writtenrectangle
- rectangle inside which the text needs to be writtenalignment
- constant specifying how the text needs to be
aligned inside the rectangle
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfTextFormatter
public void writeText(String str, PdfFont f, PdfRect rectangle, int alignment, double rotation, double firstLinePosition) throws IOException, PdfException
rotation
degrees with specified alignment, first-line position, and
font inside specified rectangle on this
PdfDocument
's current page.
The text is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
str
- text that needs to be writtenf
- font with which the text needs to be writtenrectangle
- rectangle inside which the text needs to be writtenalignment
- constant specifying how the text needs to be
aligned inside the rectanglerotation
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the text with reference to
center of its bounding boxfirstLinePosition
- position inside the rectangle where the first line
of text should begin (Applied in current measurement
unit)
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfTextFormatter
public void writeText(String str, PdfFont f, PdfRect rectangle, int alignment, double rotation, double firstLinePosition, String pageRange) throws IOException, PdfException
rotation
degrees with specified alignment, first-line position, and
font inside specified rectangle on pages in specified page
range.
The text is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
str
- text that needs to be writtenf
- text that needs to be writtenrectangle
- rectangle inside which the text needs to be writtenalignment
- constant specifying how the text needs to be
aligned inside the rectanglerotation
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the text with reference to
center of its bounding boxfirstLinePosition
- position inside the rectangle where the first line
of text should begin (Applied in current measurement
unit)pageRange
- page range on whose pages the text needs to be
written
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfTextFormatter
public void writeText(String str, PdfFont f, PdfRect rectangle, int alignment, String pageRange) throws IOException, PdfException
str
- text that needs to be writtenf
- font with which the text needs to be writtenrectangle
- rectangle inside which the text needs to be writtenalignment
- constant specifying how the text needs to be
aligned inside the rectanglepageRange
- page range on whose pages the text needs to be
written
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfTextFormatter
public void writeText(String str, PdfFont f, PdfRect rectangle, String pageRange) throws PdfException, IOException
str
- text that needs to be writtenf
- font with which the text needs to be writtenrectangle
- rectangle inside which the text needs to be writtenpageRange
- page range on whose pages the text needs to be
written
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.public void writeText(String str, PdfFont f, String pageRange) throws PdfException, IOException
str
- text that needs to be writtenf
- font with which the text needs to be writtenpageRange
- page range on whose pages the text needs to be
written
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.public void writeText(String str, PdfPoint pt) throws PdfException, IOException
PdfDocument
's current page.
str
- text that needs to be writtenpt
- PdfPoint
where the text needs to be
written
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.public void writeText(String str, PdfPoint pt, boolean wrap) throws PdfException, IOException
str
with specified wrap setting at
point pt
on this PdfDocument
's
current page.
str
- text that needs to be writtenpt
- PdfPoint
where the text needs to be
writtenwrap
- constant specifying whether the text needs to be
wrapped
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.PdfTextFormatter
public void writeText(String str, PdfPoint pt, boolean wrap, String pageRange) throws PdfException, IOException
str
with specified wrap setting at
point pt
on pages in specified page range.
str
- text that needs to be writtenpt
- PdfPoint
where the text needs to be
writtenwrap
- constant specifying whether the text needs to be
wrappedpageRange
- page range on whose pages the text needs to be
written
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.PdfTextFormatter
public void writeText(String str, PdfPoint pt, double rotation) throws IOException, PdfException
str
, rotated by rotation
degrees, at point pt
on this
PdfDocument
's current page.
The text is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
str
- text that needs to be writtenpt
- PdfPoint
where the text needs to be
writtenrotation
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the text with reference to
center of its bounding box
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void writeText(String str, PdfPoint pt, double rotation, String pageRange) throws IOException, PdfException
str
, rotated rotation
degrees, at point pt
on pages in specified page
range.
The text is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
str
- text that needs to be writtenpt
- PdfPoint where the text needs to be writtenrotation
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the text with reference to
center of its bounding boxpageRange
- page range on whose pages the text needs to be
written
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void writeText(String str, PdfPoint pt, int alignment, boolean wrap) throws IOException, PdfException
str
with specified alignment and wrap
setting at point pt
on this
PdfDocument
's current page.
str
- text that needs to be writtenpt
- PdfPoint where the text needs to be writtenalignment
- constant specifying how the text needs to be
alignedwrap
- constant specifying whether the text needs to be
wrapped
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfTextFormatter
public void writeText(String str, PdfPoint pt, int alignment, boolean wrap, String pageRange) throws IOException, PdfException
str
with specified alignment and
wrap setting at point pt
on pages in specified
page range.
str
- text that needs to be writtenpt
- PdfPoint
where the text needs to be
writtenalignment
- constant specifying how the text needs to be alignedwrap
- constant specifying whether the text needs to be
wrappedpageRange
- page range on whose pages the text needs to be
written
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfTextFormatter
public void writeText(String str, PdfPoint pt, String pageRange) throws PdfException, IOException
str
- text that needs to be writtenpt
- PdfPoint
where the text needs to be
writtenpageRange
- page range on whose pages the text needs to be
written
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.public void writeText(String str, PdfRect rectangle) throws PdfException, IOException
PdfDocument
's current page.
str
- text that needs to be writtenrectangle
- rectangle inside which the text needs to be written
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.public void writeText(String str, PdfRect rectangle, double rotation, double firstLinePosition) throws IOException, PdfException
rotation
degrees with specified first-line position inside specified
rectangle on this PdfDocument
's current page.
The text is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
str
- text that needs to be writtenrectangle
- rectangle inside which the text needs to be writtenrotation
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the text with reference to
center of its bounding boxfirstLinePosition
- position inside the rectangle where the first line
of text should begin (Applied in current measurement
unit)
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void writeText(String str, PdfRect rectangle, double rotation, double firstLinePosition, String pageRange) throws IOException, PdfException
rotation
degrees with specified first-line position inside specified
rectangle on pages in specified page range.
The text is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
str
- text that needs to be writtenrectangle
- rectangle inside which the text needs to be writtenrotation
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the text with reference to
center of its bounding boxfirstLinePosition
- position inside the rectangle where the first line
of text should begin (Applied in current measurement
unit)pageRange
- page range on whose pages the text needs to be
written
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public void writeText(String str, PdfRect rectangle, int alignment) throws PdfException, IOException
PdfDocument
's current page.
str
- text that needs to be writtenrectangle
- rectangle inside which the text needs to be writtenalignment
- constant specifying how the text needs to be
aligned inside the rectangle
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.PdfTextFormatter
public void writeText(String str, PdfRect rectangle, int alignment, double rotation, double firstLinePosition) throws IOException, PdfException
rotation
degrees with specified first-line position inside specified
rectangle on this PdfDocument
's current page.
The text is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
str
- text that needs to be writtenrectangle
- rectangle inside which the text needs to be writtenalignment
- constant specifying how the text needs to be
aligned inside the rectanglerotation
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the text with reference to
center of its bounding boxfirstLinePosition
- position inside the rectangle where the first line
of text should begin (Applied in current measurement
unit)
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfTextFormatter
public void writeText(String str, PdfRect rectangle, int alignment, double rotation, double firstLinePosition, String pageRange) throws IOException, PdfException
rotation
degrees with specified alignment and first-line position inside
specified rectangle on pages in specified page range.
The text is rotated on center of its bounding box by
angle
degrees in anti-clockwise direction.
str
- text that needs to be writtenrectangle
- rectangle inside which the text needs to be writtenalignment
- how the text needs to be aligned inside the
rectanglerotation
- (measured in anti-clockwise direction and expressed
in degrees) tilt of the text with reference to
center of its bounding boxfirstLinePosition
- position inside the rectangle where the first line
of text should begin (Applied in current measurement
unit)pageRange
- page range on whose pages the text needs to be
written
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfTextFormatter
public void writeText(String str, PdfRect rectangle, int alignment, String pageRange) throws PdfException, IOException
str
- text that needs to be writtenrectangle
- rectangle inside which the text needs to be writtenalignment
- constant specifying how the text needs to be
aligned inside the rectanglepageRange
- page range on whose pages the text needs to be
written
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.PdfTextFormatter
public void writeText(String str, PdfRect rectangle, String pageRange) throws PdfException, IOException
str
- text that needs to be writtenrectangle
- rectangle inside which the text needs to be writtenpageRange
- page range on whose pages the text needs to be
written
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.public void writeText(String str, Point pt, int alignment) throws PdfException, IOException
pt
on current
page with specified text alignment.
str
- text that needs to be renderedpt
- position on the pages where the text needs to be
renderedalignment
- constant specifyinmg alignment of text with respect
to page margins
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.Text alignment constants specified in PdfTextFormatter class.
public void writeText(String str, Point pt, int alignment, String pageRange) throws PdfException, IOException
pt
with
specified text alignment on all pages of a specified page
range.
str
- text that needs to be renderedpt
- position on the pages where the text needs to be
renderedalignment
- constant specifyinmg alignment of text with respect
to page marginspageRange
- pages where the text needs to be rendered
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.Text alignment constants specified in PdfTextFormatter class.
public void writeText(String str, String pageRange) throws PdfException, IOException
str
- text that needs to be writtenpageRange
- page range on whose pages the text needs to be
written
PdfException
- if an illegal argument is supplied.
IOException
- if an I/O error occurs.public void setFont(PdfFont defaultFont) throws PdfException
PdfStdDocument.writeText(String)
, which do not explicitly
specify a font for rendering, unlike say
PdfStdDocument.writeText(String, PdfFont)
. If a default font was not
explicitly specified, Helvetica 10 pt will be used.
defaultFont
- default font that needs to render text elements
PdfException
- if an illegal argument is supplied.PdfStdDocument.getFont()
public PdfFont getFont()
If a default font was not explicitly specified earlier, the method returns PDF font object for Helvetica 10 pt.
PdfDocument
objectPdfStdDocument.setFont(PdfFont)
public void setCph(PdfCustomPlaceholderHandler cph) throws PdfException
onCustomPlaceHolder()
event.
cph
- object that implements the
PdfCustomPlaceholderHandler
interface
PdfException
PdfCustomPlaceholderHandler
example
.
|
Free |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |