Skip to content

Instantly share code, notes, and snippets.

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-cloud/cd274bc30612034ad05d3c54b25e3e17 to your computer and use it in GitHub Desktop.
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
// 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 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