Spire.PDFViewer is a powerful PDF Viewer component for .NET. It allows developers to load PDF document from stream, file and byte array.

Thu Feb 27, 2014 1:55 am

The following throws an exception on page.ExtractText() on the first page. The pdf doc appears to load fine.. number of pages is correct after load. I have tried with multiple pdf docs to make sure its not the pdf file. The pdf loads fine in a pdf reader and also contains no images, just text. Exception is classic - "Object reference not set to an instance of an object.". Ideas?

StringBuilder sb = new StringBuilder();
Spire.Pdf.PdfDocument doc = new Spire.Pdf.PdfDocument();
doc.LoadFromFile(pdfFullPath);

foreach (Spire.Pdf.PdfPageBase page in doc.Pages)
{
txt = page.ExtractText();
if ( txt.Length > 0 )
sb.Append(txt);
}

bep802
 
Posts: 1
Joined: Wed Feb 26, 2014 8:51 pm

Thu Feb 27, 2014 4:03 am

Hello,

Thanks for your inquiry.
To help us to reproduce quickly and resolve your issue, would you please provide us your pdf file?
You also send it to support@e-iceblue.com.

Thank you.

Best wishes and have a nice day,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.PDFViewer