This gist contains code snippets related to conversion of Scanned PDF to searchable PDF document using Aspose.PDF Cloud SDK for Java. For more information, please visit
Last active
May 29, 2021 22:24
-
-
Save aspose-cloud/cd274bc30612034ad05d3c54b25e3e17 to your computer and use it in GitHub Desktop.
This Gist contains code snippets regarding conversion of Scanned PDF files to searchable PDF documents
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 ClientID and ClientSecret from https://dashboard.aspose.cloud/ | |
String clientId = "a41d01ef-dfd5-4e02-ad29-bd85fe41e3e4"; | |
String clientSecret = "d87269aade6a46cdc295b711e26809af"; | |
// createPdfApi instance | |
PdfApi pdfApi = new PdfApi(clientSecret,clientId); | |
// input PDF document | |
String name = "ocrscan.pdf"; | |
// Load the file from local system | |
File file = new File("/Users/nayyershahbaz/Downloads/" + name); | |
// upload the file to cloud storage | |
FilesUploadResult uploadResponse = pdfApi.uploadFile(name, file, null); | |
// the languages used in image file | |
String lang = "rus,eng"; | |
// perform the OCR on image PDF document | |
AsposeResponse response = pdfApi.putSearchableDocument(name, null, null, lang); | |
assertEquals(200, (int)response.getCode()); |
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
This Gist contains code snippets regarding conversion of Scanned PDF files to searchable PDF documents |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment