-
- All Implemented Interfaces:
-
java.io.Closeable,java.lang.AutoCloseable
public final class PdfTextPage implements Closeable
PdfTextPage is a wrapper around the native PdfiumCore text page It is used to get text and other information about the text on a page
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classPdfTextPage.Companion
-
Field Summary
Fields Modifier and Type Field Description private final PdfDocumentdocprivate final IntegerpageIndexprivate final LongpagePtrprivate final Map<Integer, PdfDocument.PageCount>pageMap
-
Constructor Summary
Constructors Constructor Description PdfTextPage(PdfDocument doc, Integer pageIndex, Long pagePtr, Map<Integer, PdfDocument.PageCount> pageMap)
-
Method Summary
Modifier and Type Method Description final PdfDocumentgetDoc()final IntegergetPageIndex()final LonggetPagePtr()final Map<Integer, PdfDocument.PageCount>getPageMap()final IntegertextPageCountChars()Get character count of the page final StringtextPageGetTextLegacy(Integer startIndex, Integer length)Get the text on the page final StringtextPageGetText(Integer startIndex, Integer length)final CharactertextPageGetUnicode(Integer index)Get a unicode character on the page final RectFtextPageGetCharBox(Integer index)Get the bounding box of a character on the page final IntegertextPageGetCharIndexAtPos(Double x, Double y, Double xTolerance, Double yTolerance)Get the index of the character at a given position on the page final IntegertextPageCountRects(Integer startIndex, Integer count)Get the count of rectages that bound the text on the page in a given range final RectFtextPageGetRect(Integer rectIndex)Get the bounding box of a text on the page final StringtextPageGetBoundedText(RectF rect, Integer length)Get the text bounded by the given rectangle final DoublegetFontSize(Integer charIndex)Get character font size in PostScript points (1/72th of an inch). Unitclose()Close the page and release all resources -
-
Constructor Detail
-
PdfTextPage
PdfTextPage(PdfDocument doc, Integer pageIndex, Long pagePtr, Map<Integer, PdfDocument.PageCount> pageMap)
-
-
Method Detail
-
getDoc
final PdfDocument getDoc()
-
getPageIndex
final Integer getPageIndex()
-
getPagePtr
final Long getPagePtr()
-
getPageMap
final Map<Integer, PdfDocument.PageCount> getPageMap()
-
textPageCountChars
final Integer textPageCountChars()
Get character count of the page
-
textPageGetTextLegacy
final String textPageGetTextLegacy(Integer startIndex, Integer length)
Get the text on the page
- Parameters:
startIndex- the index of the first character to getlength- the number of characters to get
-
textPageGetText
final String textPageGetText(Integer startIndex, Integer length)
-
textPageGetUnicode
final Character textPageGetUnicode(Integer index)
Get a unicode character on the page
- Parameters:
index- the index of the character to get
-
textPageGetCharBox
final RectF textPageGetCharBox(Integer index)
Get the bounding box of a character on the page
- Parameters:
index- the index of the character to get
-
textPageGetCharIndexAtPos
final Integer textPageGetCharIndexAtPos(Double x, Double y, Double xTolerance, Double yTolerance)
Get the index of the character at a given position on the page
- Parameters:
x- the x positiony- the y positionxTolerance- the x toleranceyTolerance- the y tolerance
-
textPageCountRects
final Integer textPageCountRects(Integer startIndex, Integer count)
Get the count of rectages that bound the text on the page in a given range
- Parameters:
startIndex- the index of the first character to getcount- the number of characters to get
-
textPageGetRect
final RectF textPageGetRect(Integer rectIndex)
Get the bounding box of a text on the page
- Parameters:
rectIndex- the index of the rectangle to get
-
textPageGetBoundedText
final String textPageGetBoundedText(RectF rect, Integer length)
Get the text bounded by the given rectangle
- Parameters:
rect- the rectangle to bound the textlength- the maximum number of characters to get
-
getFontSize
final Double getFontSize(Integer charIndex)
Get character font size in PostScript points (1/72th of an inch).<br></br>
- Parameters:
charIndex- the index of the character to get
-
-
-
-