Packages

trait PdfOcr extends AnyRef

Utility methods for dealing with PDFs.

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

Abstract Value Members

  1. abstract def loadPdfDocument(path: Path)(implicit ec: ExecutionContext): Future[PdfDocument]
    Attributes
    protected
  2. abstract val tesseract: Tesseract
    Attributes
    protected

Concrete 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. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. def makeSearchablePdf(in: Path, out: Path, languages: Seq[Locale], progress: (Int, Int) ⇒ Boolean)(implicit ec: ExecutionContext): Future[Unit]

    Runs OCR on each page of the input that has fewer than 100 characters of text, and outputs a valid, searchable PDF.

    Runs OCR on each page of the input that has fewer than 100 characters of text, and outputs a valid, searchable PDF.

    This method can throw some exceptions that are entirely natural:

    * PdfEncryptedException: the input PDF needs a password. * PdfInvalidException: the input PDF contains unrecoverable errors. * TesseractMissingException: Tesseract cannot be run. * TesseractLanguageMissingException: Tesseract needs a language file.

    It may also throw exceptions you should probably never see:

    * FileNotFoundException: the input file or output directory is missing. * SecurityException: you cannot read the input or write the output. * TesseractFailedException: Tesseract did not run properly. * OutOfMemoryException: PDFBox has an evil bug.

    If this method returns a failure, or if progress() returns false, out will not be written.

    in

    Path to input, which must be a valid PDF file.

    out

    Path to output, which will be overwritten or deleted.

    languages

    Languages to use for OCR.

    progress

    Method to call with (nPagesCompleted, nPagesTotal) every page. The first call will be (0, nPagesTotal) and the last call will be (nPagesTotal, nPagesTotal). If the method ever returns false, the future will resolve and out will not be written. (This is how callers can cancel a lengthy OCR Process.)

  13. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  17. def toString(): String
    Definition Classes
    AnyRef → Any
  18. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped