--- title: "OCR" url: https://docs.catalyst.zoho.com/en/sdk/java/v1/zia-services/ocr/ description: "This page describes the method to use the Optical Character Recognition feature to detect textual characters in your Java application with sample code snippets" last_updated: 2025-11-19T15:07:41Z service: Zia Services type: general related_links: - name: "OCR - API" url: /en/api/code-reference/zia-services/ocr/#OCR --- # Optical Character Recognition [Zia Optical Character Recognition](https://docs.catalyst.zoho.com/en/zia-services/help/optical-character-recognition/introduction) electronically detects textual characters in images or digital documents, and converts them into machine-encoded text. Zia OCR can recognize text in 9 international languages and 10 Indian languages. You can [check the list of languages and language codes from the API documentation](https://docs.catalyst.zoho.com/en/api/code-reference/zia-services/ocr/#OCR) > **Note:** Catalyst does not store any of the files you upload in its systems. The files you upload are used for one-time processing only. They are not used for ML model training purposes either. Catalyst components are fully compliant with all applicable data protection and privacy laws. You must specify the path to the image or document file that needs to be processed for OCR, as shown in the code below. You can also format the response you receive as shown in the sample code. The response will also include a confidence score, which defines the accuracy of the processing, in addition to the recognized text. **Allowed file formats:** ._jpg,_ ._jpeg_, ._png_, ._tiff_, ._bmp_, ._pdf_ **File size limit:** 20 MB You must specify the model type as `OCR` in `setModelType()`, and the language codes using `setLanguageCode`. These values are optional for the `OCR` model type. By default, it is processed as the `OCR` model type, and the languages are automatically detected if they are not specified. #### Sample Code Snippet **Package Imports** ```java import com.zc.component.ml.ZCContent; import com.zc.component.ml.ZCLine; import com.zc.component.ml.ZCML; import com.zc.component.ml.ZCOCRModelType; import com.zc.component.ml.ZCOCROptions; import com.zc.component.ml.ZCParagraph; import java.io.File; ``` ```java File file = new File("/Users/amelia-421/Desktop/MyImage.webp"); //Specify the file path ZCOCROptions options = ZCOCROptions.getInstance().setModelType(ZCOCRModelType.OCR).setLanguageCode("eng,tam"); //Set the model type and languages ZCContent ocrContent = ZCML.getInstance().getContent(file, options); //Call getContent() with the file object to get the detected text in ZCContent object //To get individual paragraphs List paragraphs = ocrContent.getParagraphs(); for(ZCParagraph paragraph : paragraphs) { //To get individual lines in the paragraph List paraLines = paragraph.lines; for(ZCLine line : paraLines) { //To get individual words in the line String words = line.words; String text = line.text; //Raw line text } String text = paragraph.text; //Returns the raw paragraph text } String text = ocrContent.text; //Returns the raw image text ```