Reads hOCR output from Tesseract.
A PDF document.
A PDF document.
This class is intended to be created via PdfDocument.load(...), and its
asynchronous methods use the ExecutionContext passed to
PdfDocument.load(...).
You must call PdfDocument.close when finished.
A page of a PDF document.
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.
Reads hOCR output from Tesseract.
This doesn't handle hOCR in general. It only handles Tesseract's hOCR output.
Usage:
val parser = new HocrParser(input) parser.foreach { line => line.foreach { word => System.out.println(s"Word ${word.text} at (${word.boundingBox.x}, ${word.boundingBox.y})") } }