Zia
Optical character recognition
OCR extracts the text content from an input file in JPEG, JPG, PNG, or PDF format.
To learn more about OCR, please refer to the documentation here.
CopiedFile file = new File(“filePath”);//specify the file location
//Call getContent() with the file object to get the detected text in ZCContent object
ZCContent content = ZCML.getInstance().getContent(file);
//To get separate Paragraphs
List<ZCParagraph> paragraphs = content.getParagraphs();
for(ZCParagraph paragraph : paragraphs)
{
//To get Lines of a paragraph
List<ZCLine> paraLines = paragraph.lines;
for(ZCLine line : paraLines)
{
//To get individual words of the line
String[] words = line.words;
String text = line.text; //Raw line Text
}
String text = paragraph.text; //Returns the raw paragraph text
}
String text = content.text; // Returns the raw Image Text