Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active January 17, 2022 21:11
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/c3de3417fcf8e73bdd6dd0c404bd90cb to your computer and use it in GitHub Desktop.
Save aspose-com-gists/c3de3417fcf8e73bdd6dd0c404bd90cb to your computer and use it in GitHub Desktop.
Convert Scanned PDF to Searchable PDF in Java
// Scanned multipage PDF Path
String fullPath = "multi_page.pdf";
// Initialize AsposeOcr class object
AsposeOCRPdf api = new AsposeOCRPdf();
DocumentRecognitionSettings settings = new DocumentRecognitionSettings(0,1);
// Recognize images from PDF
ArrayList<RecognitionResult> res = api.RecognizePdf(fullPath, settings);
// Save result as Searchable PDF
AsposeOCR.SaveMultipageDocument("output.pdf", Format.Pdf, res);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment