Packages

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.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. PdfPage
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new PdfPage(pdfDocument: PdfDocument, pdPage: PDPage, pageNumber: Int)

    pdfDocument

    A PdfDocument

    pdPage

    A PDPage (PDFBox internal representation)

    pageNumber

    0-based page index

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. 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 the toImage output.

    After you addHocr() and before you write the PDFDocument, toText() will have undefined behavior.

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  12. 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.)

  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  17. val pageNumber: Int
  18. val pdPage: PDPage
  19. val pdfDocument: PdfDocument
  20. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  21. def toImage: BufferedImage

    Renders the page to an image.

    Renders the page to an image.

    Annotations
    @throws( classOf[PdfInvalidException] )
  22. 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] )
  23. 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 pdDocument is 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.)

  24. def toString(): String
    Definition Classes
    AnyRef → Any
  25. 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] )
  26. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped