Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Fri Sep 26, 2014 10:07 am

Hi,

When I try to extract text from a PDF file, it throws the error:

Unexpected token DictionaryEnd before 7320

My code is:

Dim doc As New PdfDocument()
doc.LoadFromFile("C:\Cop\A.PDF") << Here throws the error
Dim buffer As New StringBuilder()
Dim images As IList(Of Image) = New List(Of Image)()
For Each page As PdfPageBase In doc.Pages
buffer.Append(page.ExtractText())
Next page
doc.Close()
'save text
Dim fileName As String = "C:\Cop\A.txt"
File.WriteAllText(fileName, buffer.ToString())

Thanks.

Best regards,
galder

inyazar
 
Posts: 24
Joined: Wed Jul 03, 2013 8:38 am

Sun Sep 28, 2014 1:52 am

Dear galder,

Thanks for your inquiry.
To help us reproduce your issue, please attach your pdf document.
You also can send it to amy.zhao@e-iceblue.com. Thanks.

Best wishes,
Amy
E-iceblue support team
User avatar

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

Fri Oct 03, 2014 2:01 pm

Hi Amy,

I have another problem with an extraction text from PDF.

It throws me the error 'FormatException was unhandled'

This is my code (I take it from your web):

Dim doc As New Spire.Pdf.PdfDocument()
doc.LoadFromFile("C:\Cop\Parte2.PDF")
Dim buffer As New StringBuilder()
Dim images As IList(Of Image) = New List(Of Image)()
For Each page As Spire.Pdf.PdfPageBase In doc.Pages
buffer.Append(page.ExtractText()) >> Here throws it the error
Next page

I'm using Visual Studio 2010 SP1 in a computer with Windows 7 Pro SP1 with your Spire.Pdf 3.1.43.4020

Thanks.

Best regards

inyazar
 
Posts: 24
Joined: Wed Jul 03, 2013 8:38 am

Mon Oct 06, 2014 1:59 am

Hello,

Sorry for late reply as weekend.
Please attach your test document to us if convenient, which may help us reproduce the issue quickly. We promise to keep your document confidential and we will not use it for any other purpose. BTW, You could send it to our Email(support@e-iceblue.com).
Thanks,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Tue Oct 07, 2014 8:36 am

Hello Gary,

I did not get the error in Spire PDF version 2.8.70.4020, but in other version newer than that i get it.

Is anything change in the newer version that causes me the problem?
The PDF version is 1.5 created with Office 2007.

Thnks,
Galder

inyazar
 
Posts: 24
Joined: Wed Jul 03, 2013 8:38 am

Tue Oct 07, 2014 10:01 am

Dear inyazar,

Thanks for your reply.

Please upload the pdf file to help us reproduce the issue if convenience.
You can also send it to buring.liu@e-iceblue.com.

Best regards,
Burning
E-iceblue Support Team
Best Regards,
Burning
E-iceblue Support Team
User avatar

burning.liu
 
Posts: 406
Joined: Mon Aug 04, 2014 6:47 am

Return to Spire.PDF