How to read text from scanned pdf please suggest any freetool which has no has restrictions like only able to extract first three pages from a pdf document?
Is there way to convert scanned pdf to normal pdf c#
How to read text from scanned pdf please suggest any freetool which has no has restrictions like only able to extract first three pages from a pdf document?
Is there way to convert scanned pdf to normal pdf c#
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Rajeesh MenothRank #118 · 18.4K reputationPosted Dec 16, 2022, 1:49 AM EST
Hi Kavya,
I don't think any free source for this kind of major extraction and the concept is called "Optical Character Recognition".
You can refer to my article: https://www.c-sharpcorner.com/article/cognitive-services-optical-character-recognition-ocr-from-an-image-using-com/
Rajesh LoharRank #5,240 · 306 reputationPosted Dec 16, 2022, 12:15 AM EST
Hi,
Use ITextSharp.
Please refer below
https://www.codeproject.com/Questions/243295/Is-this-possible-to-Extract-Text-from-Scanned-PDF
Thanks,
Kip Hackman61 reputationPosted Jun 8, 2023, 3:18 PM EDT
I am unaware of any free API that can do what you are looking for, but you can use the LEADTOOLS Recognition SDK technology in your application.
https://www.leadtools.com/sdk/ocr
You can leverage the IOcrEngine class, to gather the text of any page of the scanned document. LEADTOOLS also offers the ability to use TWAIN to gather the image from the scan job to easily facilitate the scanned image to the IOcrEngine for recognition.
Here is some sample code:
string file = @"FILE PATH TO INPUT IMAGE FILE"; string outFile = @"FILE PATH TO OUTPUT PDF FILE"; // Initialize the OCR engine IOcrEngine _ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.LEAD); // Start up the engine _ocrEngine.Startup(null, null, null, @"\LEADTOOLS22\Bin\Common\OcrLEADRuntime"); // Create a document using (IOcrDocument ocrDocument = _ocrEngine.DocumentManager.CreateDocument(null, OcrCreateDocumentOptions.AutoDeleteFile)) using (RasterCodecs _codecs = new RasterCodecs()) { CodecsImageInfo _info = _codecs.GetInformation(file, true); if (_info.TotalPages <= 3) { for(int i = 1; i <=3; i++) { using (RasterImage _image = _codecs.Load(file, i)) { // Create IOcrPage from loaded image IOcrPage _ocrPage = _ocrEngine.CreatePage(_image, OcrImageSharingMode.AutoDispose); // Recognize Text _ocrPage.Recognize(null); // Add the page ocrDocument.Pages.Add(_ocrPage); } } } // Save as PDF ocrDocument.Save(outFile, DocumentFormat.Pdf, null); }Sam HobbsRank #107 · 20.5K reputationPosted Jun 10, 2023, 5:34 PM EDT
I have been using Tesseract in a C# program but it has been a while therefore I do not remember much. Also they apparently have made substantial improvements after I wrote my program.
Tesseract documentation | Tesseract OCR (tesseract-ocr.github.io)
When I posted this I did not see that this question is from half a year ago. I hope this helps someone at least.