using (OCRProcessor processor = new OCRProcessor(AppDomain.CurrentDomain.BaseDirectory + "bin\\lib")) { //Language to process the OCR processor.Settings.Language = Languages.English; //Process OCR by providing loaded PDF document, Data dictionary and language processor.PerformOCR(lDoc, "d:\\"); //Save the OCR processed PDF document in the disk Response.Clear(); //Save the pdf file lDoc.Save(@"d:\Sample.pdf"); lDoc.Close(true); }
IN the app/bin/lib:
someone have any suggestions?
// Initialize the OCR processor
PdfLoadedDocument lDoc = new PdfLoadedDocument(Server.MapPath("/App_Data/Region.pdf"));
//Load the existing PDF document.
using (OCRProcessor processor = new OCRProcessor(Server.MapPath(@"\App_Data\Tesseract binaries\")))
{
//Language to process the OCR
processor.Settings.Language = Languages.English;
//Process OCR by providing loaded PDF document, Data dictionary and language
string resulttext = processor.PerformOCR(lDoc, Server.MapPath(@"\App_Data\Tessdata\"));
}
//Save the document
lDoc.Save(Server.MapPath("/Output/output.pdf"));
//close the document
lDoc.Close(true);
Sample link:
http://www.syncfusion.com/downloads/support/forum/121532/ze/MvcApplication11860559793
Please try this and let us know if you need any further assistance.
Regards,
Abirami.
processor.PerformOCR(lDoc, "d:\\");
That I made the mistake
It works good now.
The example in the link gives me errors.
OCRProcessor processor = new OCRProcessor(@"TesseractBinaries\");
http://help.syncfusion.com/file-formats/pdf/working-with-ocr#prerequisites-and-setting-up-the-tesseract-engine
Regards,
Chinnu