Created
January 26, 2022 11:45
-
-
Save aspose-com-gists/55d48e68f63e416b1c7882a7c832758e to your computer and use it in GitHub Desktop.
Convert Image to Excel with OCR in Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Create api instance | |
AsposeOCR api = new AsposeOCR(); | |
try { | |
RecognitionSettings settings = new RecognitionSettings(); | |
RecognitionResult result = api.RecognizePage("OCR.png", settings); | |
// Save OCR results as XLSX Excel file | |
result.save("OCRjava.xlsx", Format.Xlsx); | |
} catch (IOException e) { | |
e.printStackTrace(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get image for recognize | |
String uri = "https://qph.fs.quoracdn.net/main-qimg-0ff82d0dc3543dcd3b06028f5476c2e4"; | |
//Create api instance | |
AsposeOCR api = new AsposeOCR(); | |
try { | |
RecognitionSettings set = new RecognitionSettings(); | |
RecognitionResult result = api.RecognizePageFromUri(uri, set); | |
// Save OCR results as XLSX Excel file | |
result.save("OCRjava.xlsx", Format.Xlsx); | |
} catch (IOException e) { | |
e.printStackTrace(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment