Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Created January 17, 2022 21:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspose-com-gists/f0cfe4eef8e1f4dfee3b9a8c2b825218 to your computer and use it in GitHub Desktop.
Save aspose-com-gists/f0cfe4eef8e1f4dfee3b9a8c2b825218 to your computer and use it in GitHub Desktop.
Create Scanned PDF to Excel Converter with OCR in Java
// Scanned PDF file path
String fullPath = "scanned.pdf";
// Initialize AsposeOcr class object
AsposeOCRPdf api = new AsposeOCRPdf();
// Initialize DocumentRecognitionSettings class object
DocumentRecognitionSettings settings = new DocumentRecognitionSettings(0,1);
// Recognize images from PDF
ArrayList<RecognitionResult> res = api.RecognizePdf(fullPath, settings);
// Save result as Excel XLSX file
AsposeOCR.SaveMultipageDocument("output.xlsx", Format.Xlsx, res);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment