class PdfPage extends AnyRef
A page of a PDF document.
A PDF document can throw a PdfInvalidException at any time during reading.
A PdfPage will only be valid so long as its parent PdfDocument's close
method has not been called.
- Alphabetic
- By Inheritance
- PdfPage
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
PdfPage(pdfDocument: PdfDocument, pdPage: PDPage, pageNumber: Int)
- pdfDocument
A PdfDocument
- pdPage
A PDPage (PDFBox internal representation)
- pageNumber
0-based page index
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
addHocr(hocr: Array[Byte]): Unit
Uses hOCR data to add invisible text to the page.
Uses hOCR data to add invisible text to the page.
This will only work with Tesseract 3.03's hOCR output. It assumes the hOCR output uses the same resolution as returned by
bestDpi-- that is, the resolution of thetoImageoutput.After you addHocr() and before you write the PDFDocument, toText() will have undefined behavior.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
isFromOcr: Boolean
Returns true iff there is a /Line annotation with RGB 0xd0cd0c.
Returns true iff there is a /Line annotation with RGB 0xd0cd0c.
(Perhaps cleaner would be to check for our font. But pdfium does not give an interface for reading fonts yet, and we want our pdfium-based splitter to recognize this mark.)
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- val pageNumber: Int
- val pdPage: PDPage
- val pdfDocument: PdfDocument
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toImage: BufferedImage
Renders the page to an image.
Renders the page to an image.
- Annotations
- @throws( classOf[PdfInvalidException] )
-
def
toImageWithoutText: BufferedImage
Renders the page to an image, omitting all text.
Renders the page to an image, omitting all text.
In other words, if a PDF has a stream with a rectangle, some text and an image, this method will return an imaage with a rectangle and an image.
- Annotations
- @throws( classOf[PdfInvalidException] )
-
def
toPdf: Array[Byte]
Returns a one-page PDF, as a byte array.
Returns a one-page PDF, as a byte array.
Even if the original
pdDocumentis a single page, this method will return a whole new page. (That's so we can avoid blocking re-reading the original input file.)The purpose of this output PDF is *display*. (Another image format would be more ideal; we output PDF because we always have, not because we should.)
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
toText: String
Returns all the text we can read from the document.
Returns all the text we can read from the document.
After you addHocr() and before you write the PDFDocument, toText() will have undefined behavior.
- Annotations
- @throws( classOf[PdfInvalidException] )
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )