Hello guys,
I have got a scenarion where i want to read text from PDF including tables.
With itextsharp i am doing this but for few PDF its not working at all.
Suppose, if my PDF contains paragraphs on my 1st page and table on second page then its reading but when my PDF contains table on 1st page itself then its not reading.
I tried this below link :
https://bytescout.com/products/developer/pdfextractorsdk/how-to-extract-text-from-pdf-to-filestream-using-pdf-extractor-sdk-in-csharp
but still i am unable to extract text fully from my PDF i am interested in extracting text from PDF.
Please find my code below.
Is there any 3rd part dll ???
As far as i have searched there is no provision to read table from PDF.
Please suggest guys.
Thanks

Mohamed AbedallahRank #2,074 · 697 reputationPosted Jan 17, 2018, 6:30 AM EST
If you still cannot get the text from table, this may indicate that text in table is an image based and not actual text. If this is the case, you can use the OCR functions of LEADTOOLS to recognize the whole pages of the PDF then get the recognized text. The following code shows how you can do that:
Leon DRank #851 · 2.6K reputationPosted Jan 17, 2018, 3:22 PM EST
Ashwanikumar singh31 reputationPosted Jan 17, 2018, 7:08 PM EST
{
// string path = @"C:\Users\product\Downloads\AIRLINE INVOICES\Can't Read\TN-10419-17-18.pdf";
StringBuilder sb;
sb = new StringBuilder();
PDFDocument document = new PDFDocument(@"C:\Users\product\Downloads\AIRLINE INVOICES\Can't Read\TN-10419-17-18.pdf"); //here i am getting exception
PDFParsePagesOptions options = PDFParsePagesOptions.Objects;
document.ParsePages(options, 1, -1);
foreach (PDFDocumentPage page in document.Pages)
{
Console.WriteLine("Page #" + page.PageNumber.ToString() + " Started");
foreach (PDFObject obj in page.Objects)
{
if (obj.ObjectType == PDFObjectType.Text)
{
if (obj.TextProperties.IsEndOfLine)
sb.AppendLine(obj.Code.ToString());
else
sb.Append(obj.Code);
}
}
Console.WriteLine("Page #" + page.PageNumber.ToString() + " finished");
}
return sb.ToString();
}
Srikant MaruwadaRank #3,483 · 416 reputationPosted Jan 16, 2018, 7:55 PM EST
Pusting72 reputationPosted Jan 18, 2018, 12:21 AM EST
Mohamed AbedallahRank #2,074 · 697 reputationPosted Jan 25, 2018, 6:04 AM EST
https://www.leadtools.com/help/leadtools/v19/dh/l/rasterexceptioncode.html
If you still can't solve the problem, LEADTOOLS has free email support, so try to send full details about the problem to [email protected]
Tony Chen27 reputationPosted Nov 16, 2018, 4:54 PM EST