public interface Page
Modifier and Type | Field and Description |
---|---|
static int |
COLUMN_POSITION_HALVES
A constant parameter for use with
addColumnPartition(int) . |
static int |
COLUMN_POSITION_QUARTERS
A constant parameter for use with
addColumnPartition(int) . |
static int |
COLUMN_POSITION_THIRDS
A constant parameter for use with
addColumnPartition(int) . |
Modifier and Type | Method and Description |
---|---|
void |
addColumnPartition(int xcoord)
Adds the given coordinate as an acceptable midline between columns, used when
this page is segmented.
|
Page |
crop(Region area)
Returns a
Page instance that contains only the content held by
this Page instance that intersects the given "query" area. |
PDFTextStreamConfig |
getConfig()
Returns the
PDFTextStreamConfig instance provided to this page by its parent PDFTextStream
instance. |
Region |
getCropBox()
The "crop box" defined by the PDF for this page, expressed in user space units as with
getPageHeight() and getPageWidth() . |
int |
getPageHeight()
Returns the height of this page in PDF "default user space units" (as specified by the PDF spec).
|
int |
getPageNumber()
Returns this Page's page number.
|
int |
getPageWidth()
Returns the width of this page in PDF "default user space units" (as specified by the PDF spec).
|
java.lang.String |
getPdfName()
Returns the name of the PDF document from which this Page was extracted.
|
int |
getRotationTheta()
Returns the number of degrees by which the page has been rotated clockwise.
|
PDFTextStream |
getStream()
Returns the
PDFTextStream instance from which this Page was sourced. |
BlockParent |
getTextContent()
Returns a BlockParent instance that contains all Block instances held by this Page, which
in turn hold all text content for this Page.
|
void |
pipe(OutputHandler tgt)
Extracts all text from this page, sending necessary events to the given
OutputHandler implementation. |
static final int COLUMN_POSITION_HALVES
addColumnPartition(int)
.static final int COLUMN_POSITION_THIRDS
addColumnPartition(int)
.static final int COLUMN_POSITION_QUARTERS
addColumnPartition(int)
.void addColumnPartition(int xcoord) throws java.lang.UnsupportedOperationException
COLUMN_POSITION_HALVES
, COLUMN_POSITION_THIRDS
,
or COLUMN_POSITION_QUARTERS
are provided. Those constants "expand"
into multiple column partitions; e.g. specifying COLUMN_POSITION_THIRDS
will result in two column partitions, one at getPageWidth() / 3
and another
at 2 * getPageWidth() / 3
.
getTextContent()
or pipe(OutputHandler)
are invoked.java.lang.UnsupportedOperationException
- if this Page's implementation does not
support specifying column positions.PDFTextStream getStream()
PDFTextStream
instance from which this Page was sourced.java.lang.String getPdfName()
int getPageNumber()
int getPageWidth()
int getPageHeight()
Region getCropBox()
getPageHeight()
and getPageWidth()
. This rectangle will default to the page
width and height if it is not otherwise specified.int getRotationTheta()
void pipe(OutputHandler tgt) throws java.io.IOException
OutputHandler
implementation.
Unless custom text event handling is required, using an OutputTarget
is the easiest way to
take advantage of this function.java.io.IOException
BlockParent getTextContent()
PDFTextStreamConfig getConfig()
PDFTextStreamConfig
instance provided to this page by its parent PDFTextStream
instance.Page crop(Region area)
Page
instance that contains only the content held by
this Page
instance that intersects the given "query" area.
If all of the content held by this instance is intersected by the query area, then this
instance may be returned unchanged. If no content in this Page
intersects the query area, then an empty Page
instance will be
returned.java.lang.UnsupportedOperationException
- if this Page
implementation does not support
the crop(Region) functionBlock.crop(Region)