You can read all the details at: Convert Image to Searchable PDF with OCR using C#
Last active
December 23, 2021 06:31
-
-
Save aspose-com-gists/116dd2536967d784fb63cebcc96f2ec3 to your computer and use it in GitHub Desktop.
Convert JPG PNG TIFF Image to Searchable PDF with OCR using C#
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
// Set path for input image to recognize | |
string image = "p24.jpg"; | |
// Initialize AsposeOcr class instance | |
AsposeOcr api = new AsposeOcr(); | |
// Recognize input image with RecognizeImage method | |
RecognitionResult result = api.RecognizeImage(image, new RecognitionSettings()); | |
// Save output to searchable PDF file | |
result.Save("test.pdf", SaveFormat.Pdf); |
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
// Set path for input image to recognize | |
string image = "p24.jpg"; | |
// Initialize AsposeOcr class object | |
AsposeOcr api = new AsposeOcr(); | |
// Initialize RecognitionSettings class instance | |
RecognitionSettings settings = new RecognitionSettings(); | |
// Calculate skew angle of the image | |
float angle = api.CalculateSkew(image); | |
settings.SkewAngle = angle; | |
// Recognize input image with RecognizeImage method | |
RecognitionResult result = api.RecognizeImage(image, settings); | |
// Save image to searchable PDF file with OCR | |
result.Save("Test.pdf", SaveFormat.Pdf); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment