Package net.sourceforge.tess4j.util
Class Hocr2PdfParser
java.lang.Object
net.sourceforge.tess4j.util.Hocr2PdfParser
- All Implemented Interfaces:
ContentHandler
,ErrorHandler
-
Field Summary
-
Constructor Summary
ConstructorDescriptionHocr2PdfParser
(String hocrFilepath, org.apache.pdfbox.pdmodel.PDDocument pdDocument, boolean visible, boolean useHocrLineToY, String fontName) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addTextToPDF
(String[] imgCoords, String text) void
characters
(char[] ch, int start, int length) void
void
endElement
(String uri, String localName, String qName) void
endPrefixMapping
(String prefix) void
error
(SAXParseException exception) void
fatalError
(SAXParseException exception) void
ignorableWhitespace
(char[] ch, int start, int length) void
parse()
void
processingInstruction
(String target, String data) void
setDocumentLocator
(Locator locator) void
skippedEntity
(String name) void
void
startElement
(String uri, String localName, String qName, Attributes atts) void
startPrefixMapping
(String prefix, String uri) void
warning
(SAXParseException exception) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.xml.sax.ContentHandler
declaration
-
Field Details
-
SPACE
- See Also:
-
BBOX
- See Also:
-
TITLE
- See Also:
-
SEMICOL
- See Also:
-
DIV
- See Also:
-
SPAN
- See Also:
-
OCRX_WORD
- See Also:
-
OCR_WORD
- See Also:
-
OCR_LINE
- See Also:
-
CLASS
- See Also:
-
OCR_PAGE
- See Also:
-
-
Constructor Details
-
Hocr2PdfParser
public Hocr2PdfParser(String hocrFilepath, org.apache.pdfbox.pdmodel.PDDocument pdDocument, boolean visible, boolean useHocrLineToY, String fontName) throws IOException - Throws:
IOException
-
-
Method Details
-
setDocumentLocator
- Specified by:
setDocumentLocator
in interfaceContentHandler
-
startDocument
- Specified by:
startDocument
in interfaceContentHandler
- Throws:
SAXException
-
endDocument
- Specified by:
endDocument
in interfaceContentHandler
- Throws:
SAXException
-
startPrefixMapping
- Specified by:
startPrefixMapping
in interfaceContentHandler
- Throws:
SAXException
-
endPrefixMapping
- Specified by:
endPrefixMapping
in interfaceContentHandler
- Throws:
SAXException
-
startElement
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException - Specified by:
startElement
in interfaceContentHandler
- Throws:
SAXException
-
endElement
- Specified by:
endElement
in interfaceContentHandler
- Throws:
SAXException
-
characters
- Specified by:
characters
in interfaceContentHandler
- Throws:
SAXException
-
ignorableWhitespace
- Specified by:
ignorableWhitespace
in interfaceContentHandler
- Throws:
SAXException
-
processingInstruction
- Specified by:
processingInstruction
in interfaceContentHandler
- Throws:
SAXException
-
skippedEntity
- Specified by:
skippedEntity
in interfaceContentHandler
- Throws:
SAXException
-
warning
- Specified by:
warning
in interfaceErrorHandler
- Throws:
SAXException
-
error
- Specified by:
error
in interfaceErrorHandler
- Throws:
SAXException
-
fatalError
- Specified by:
fatalError
in interfaceErrorHandler
- Throws:
SAXException
-
addTextToPDF
- Throws:
SAXException
-
parse
-