Hi all, I am working on a project where I want to be able to upload an image(pdf) of a form that was filled in by hand then to convert it into text that will be later saved in a database. I am hoping to use OCR for recognition but I've never used it before so any help will be appreciated.
This will be done in WPF and it's a desktop application.
Thank you
Loading

Viorel S81 reputationPosted Jul 25, 2021, 9:10 PM EDT
Avuya MxoliRank #7,940 · 231 reputationPosted Apr 5, 2012, 3:22 AM EDT
George ericRank #9,604 · 204 reputationPosted Apr 10, 2012, 1:39 AM EDT
I am sorry that I don't know the direct solution to convert text from pdf to editable text. But I came up with this. You extract text from pdf and then write it to the editable text. How do you think?
With the help of Spire.PDF.
//Create a pdf document.
PdfDocument doc = new PdfDocument();
doc.LoadFromFile(@"Sample2.pdf");
StringBuilder buffer = new StringBuilder(); images = new List();
IList
foreach (PdfPageBase page in doc.Pages)
{
buffer.Append(page.ExtractText());
foreach (Image image in page.ExtractImages())
{
images.Add(image);
}
}
doc.Close();
//save text
String fileName = "TextInPdf.txt";
File.WriteAllText(fileName, buffer.ToString());
//save image
int index = 0;
foreach (Image image in images)
{
String imageFileName
= String.Format("Image-{0}.png", index++);
image.Save(imageFileName, ImageFormat.Png);
}
//Launching the Text file.
System.Diagnostics.Process.Start(fileName);
}
Avuya MxoliRank #7,940 · 231 reputationPosted Apr 11, 2012, 10:06 AM EDT
George ericRank #9,604 · 204 reputationPosted Apr 11, 2012, 5:51 PM EDT
Avuya MxoliRank #7,940 · 231 reputationPosted Apr 12, 2012, 6:19 AM EDT
George ericRank #9,604 · 204 reputationPosted Apr 12, 2012, 5:52 PM EDT
George ericRank #9,604 · 204 reputationPosted Apr 12, 2012, 6:05 PM EDT
Bennet Raj17 reputationPosted Jun 20, 2012, 6:00 AM EDT
George ericRank #9,604 · 204 reputationPosted Jun 20, 2012, 6:49 PM EDT
George ericRank #9,604 · 204 reputationPosted Jun 20, 2012, 6:49 PM EDT
Jony Green103 reputationPosted Oct 12, 2015, 1:22 AM EDT
Kurt Ambrose127 reputationPosted Jul 23, 2021, 9:36 AM EDT