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.
Wed Jul 29, 2015 7:59 pm
Hello,
I downloaded the free .NET Spire.pdf and I'm trying to searh a text and highlight it.
But I have an error on the ExtractText method..
"An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll"
"Additional information: Le format de la chaîne d'entrée est incorrect."
and here is the code I'm running in console application
if (item == @"D:\TEMP\TEST_PDF\page_0105.pdf")
{
PdfDocument pdf = new PdfDocument();
pdf.LoadFromFile(item);
StringBuilder content = new StringBuilder();
content.Append(pdf.Pages[0].ExtractText());
String fileName = @"D:\TEMP\TextFromPDF.txt";
File.WriteAllText(fileName, content.ToString());
System.Diagnostics.Process.Start("TextFromPDF.txt");
pdf.Close();
}
I tried the code finded in your tutorials code too but the same error appears..
Can you help me please ?
-

NAL
-
- Posts: 5
- Joined: Wed Jul 29, 2015 5:59 pm
Thu Jul 30, 2015 8:24 am
Hello,
Thanks for your inquiry.
Could you please offer us your sample pdf file? It would be helpful to replicate the issue and work out the solution for you ASAP.
Please kindly note that firstly you need to compress it and upload.
Or you can send it to us (
[email protected] ) via email.
Best Regards,
Sweety
E-iceblue support team
-


sweety1
-
- Posts: 539
- Joined: Wed Mar 11, 2015 1:14 am
Thu Jul 30, 2015 9:35 am
Hi,
thanks for reply.
Here is the pdf file.
Login to view the files attached to this post.
-

NAL
-
- Posts: 5
- Joined: Wed Jul 29, 2015 5:59 pm
Fri Jul 31, 2015 5:51 am
Hello,
Thanks for your information.
I have tested your issue with the file you provided. It worked well. here is the result in the attachment. And below is the code I use.
- Code: Select all
PdfDocument document = new PdfDocument();
document.LoadFromFile(@" D:\testfile\Pdf\page_0105\page_0105.pdf");
StringBuilder content = new StringBuilder();
content.Append(document.Pages[0].ExtractText());
String fileName = "TextFromPDF5497.txt";
File.WriteAllText(fileName, content.ToString());
System.Diagnostics.Process.Start(fileName);
Best Regards,
Sweety
E-iceblue support team
Login to view the files attached to this post.
-


sweety1
-
- Posts: 539
- Joined: Wed Mar 11, 2015 1:14 am
Fri Jul 31, 2015 1:56 pm
Hello,
Thanks for reply.
I don't understand because it still doesn't works for me..(see picture)
Can you send me your project to test it ?
Login to view the files attached to this post.
-

NAL
-
- Posts: 5
- Joined: Wed Jul 29, 2015 5:59 pm
Sat Aug 01, 2015 12:29 am
I have the same problem in your sample project..
It maybe because of a wrong configuration security of visual studio..I tried some changement but it still doesn't work

-

NAL
-
- Posts: 5
- Joined: Wed Jul 29, 2015 5:59 pm
Mon Aug 03, 2015 3:41 am
Hello,
Thanks for your reply.
Here is the project in the attachment. Please try it.
I have removed the dlls( Spire.Pdf.dll and Spire.License.dll). Please add them when you run it.
Please feel free to contact us if you have any problems.
Best Regards,
Sweety
E-iceblue support team
Login to view the files attached to this post.
-


sweety1
-
- Posts: 539
- Joined: Wed Mar 11, 2015 1:14 am
Mon Aug 03, 2015 6:33 pm
Hi,
Thank you.
So..afeter many tries, it doesn't works. I saw the error in the output :
'SpirePDF_Test.vshost.exe' (CLR v4.0.30319: SpirePDF_Test.vshost.exe): Loaded 'D:\DEV\SpirePDF_Test\SpirePDF_Test\bin\Debug\SpirePDF_Test.exe'. Symbols loaded.
'SpirePDF_Test.vshost.exe' (CLR v4.0.30319: SpirePDF_Test.vshost.exe): Loaded 'D:\DEV\SpirePDF_Test\SpirePDF_Test\bin\Debug\Spire.Pdf.dll'. Module was built without symbols.
'SpirePDF_Test.vshost.exe' (CLR v4.0.30319: SpirePDF_Test.vshost.exe): Loaded 'D:\DEV\SpirePDF_Test\SpirePDF_Test\bin\Debug\Spire.License.dll'. Module was built without symbols.
'SpirePDF_Test.vshost.exe' (CLR v4.0.30319: SpirePDF_Test.vshost.exe): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\mscorlib.resources\v4.0_4.0.0.0_fr_b77a5c561934e089\mscorlib.resources.dll'. Module was built without symbols.
Exception thrown: 'System.NullReferenceException' in Spire.License.dll
Exception thrown: 'System.IO.FileNotFoundException' in Spire.License.dll
Exception thrown: 'System.NullReferenceException' in Spire.License.dll
Exception thrown: 'System.NullReferenceException' in Spire.License.dll
Exception thrown: 'System.IO.FileNotFoundException' in Spire.License.dll
Exception thrown: 'System.NullReferenceException' in Spire.License.dll
Exception thrown: 'System.FormatException' in mscorlib.dll
'SpirePDF_Test.vshost.exe' (CLR v4.0.30319: SpirePDF_Test.vshost.exe): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'. Symbols loaded.
The program '[11852] SpirePDF_Test.vshost.exe' has exited with code -1 (0xffffffff).
If someone has already have the same error, I think it is not about the code but about some configuration..
-

NAL
-
- Posts: 5
- Joined: Wed Jul 29, 2015 5:59 pm
Tue Aug 04, 2015 9:26 am
Hello,
Thanks for your reply.
Sorry to hear that it still doesn't work. This error may be not caused by our product, please try to re-install your visual studio or run the project on another computer.
Best Regards,
Sweety
E-iceblue support team
-


sweety1
-
- Posts: 539
- Joined: Wed Mar 11, 2015 1:14 am
Sat Aug 22, 2015 2:44 pm
Hi, I'm facing the same problem.
I'm using "spire.pdf-fe_3.2" in a clean installation of Visual Studio 2013 Ultimate, Windows 8.1 x64.
I even ran the sample included in the installer, and the problem is still there.
Regards.
-

adrielairaldo
-
- Posts: 1
- Joined: Sat Aug 22, 2015 2:22 pm
Mon Aug 24, 2015 2:10 am
Hello,
Thanks for your inquiry.
I have noticed your issue. And I have posted the issue to our dev team. We will inform you when it is fixed. Sorry for the inconvenience.
Best Regards,
Sweety
E-iceblue support team
-


sweety1
-
- Posts: 539
- Joined: Wed Mar 11, 2015 1:14 am
Tue Sep 08, 2015 3:11 am
Hello,
Sorry to keep you waiting.
The new version of Spire.Pdf( Spire.PDF Pack(Hot Fix) Version:3.5.34 ) solved your issue has been released. Please download it via link below and have a try.
http://www.e-iceblue.com/Download/download-pdf-for-net-now.htmlBest Regards,
Sweety
E-iceblue support team
-


sweety1
-
- Posts: 539
- Joined: Wed Mar 11, 2015 1:14 am
Fri Sep 11, 2015 7:47 am
Hello,
Have you tried the
Spire.PDF Pack(Hot Fix) Version:3.5.34?
Has your issue been resolved?
Thanks for your feedback.
Best Regards,
Sweety
E-iceblue support team
-


sweety1
-
- Posts: 539
- Joined: Wed Mar 11, 2015 1:14 am