Package com.logicaldoc.parser
Class ImageParser
java.lang.Object
com.logicaldoc.core.parser.AbstractParser
com.logicaldoc.parser.ImageParser
- All Implemented Interfaces:
com.logicaldoc.core.parser.Parser
public class ImageParser
extends com.logicaldoc.core.parser.AbstractParser
This parser reads images (supported formats are: jpg, jfif, bmp, jpeg, wbmp,
png, gif) and extracts text using OCR.
- Since:
- 3.5
- Author:
- Alessandro Gasparini - LogicalDOC
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
countPages
(File input, String filename) int
countPages
(InputStream input, String filename) void
extractMetadata
(File file, StringBuilder output) Extracts all image metadata placing them into the contentvoid
internalParse
(InputStream input, com.logicaldoc.core.parser.ParseParameters parameters, StringBuilder output) parse
(File file, String filename, String encoding, Locale locale, String tenant, com.logicaldoc.core.document.Document document, String fileVersion) Methods inherited from class com.logicaldoc.core.parser.AbstractParser
parse, parse, parse
-
Constructor Details
-
ImageParser
public ImageParser()
-
-
Method Details
-
parse
public String parse(File file, String filename, String encoding, Locale locale, String tenant, com.logicaldoc.core.document.Document document, String fileVersion) throws com.logicaldoc.core.parser.ParsingException - Specified by:
parse
in interfacecom.logicaldoc.core.parser.Parser
- Overrides:
parse
in classcom.logicaldoc.core.parser.AbstractParser
- Throws:
com.logicaldoc.core.parser.ParsingException
-
internalParse
public void internalParse(InputStream input, com.logicaldoc.core.parser.ParseParameters parameters, StringBuilder output) throws com.logicaldoc.core.parser.ParsingException - Throws:
com.logicaldoc.core.parser.ParsingException
-
extractMetadata
Extracts all image metadata placing them into the content- Parameters:
file
- the image fileoutput
- the buffer that hosts the extracted metadata
-
countPages
- Specified by:
countPages
in interfacecom.logicaldoc.core.parser.Parser
- Overrides:
countPages
in classcom.logicaldoc.core.parser.AbstractParser
-
countPages
- Specified by:
countPages
in interfacecom.logicaldoc.core.parser.Parser
- Overrides:
countPages
in classcom.logicaldoc.core.parser.AbstractParser
-