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 20, 2022 8:02 am

I'm creating a little program on Eclipse, using Java language in a Maven Project, to convert PDF files into Excel files.
But when I create those files and try to open them, it gives me an error saying that there's an error and it askes me to try to bring back the datas.
When I click "Yes", it generates a blank excel file saying that it had to remove everything in the worksheet.
It gives me a log file but it seems that i can't post urls, so i can't post it in there.

I can't go through this please help me!!!!!

Oh and these are my java method that i use to convert my list of files:

Java method:
private static void conversionPDFtoEXCEL() {
for (int i = 0; i < file.size(); i++) {
File convF = file.get(i);

pdfFileName = convF.getName();
excelFileName = pdfFileName.replaceFirst(".pdf", ".xlsx");
dir = convF.getAbsolutePath().replaceFirst(pdfFileName, "");

PdfDocument pdf = new PdfDocument(dir + pdfFileName);

pdf.loadFromFile(dir + pdfFileName);
System.out.println("Conversione del file .pdf seguente: " + pdfFileName);

pdf.saveToFile(dir + excelFileName, FileFormat.XLSX);
}
}

In my Pom.xml file (that i can't show you cause of the urls) i imported spire.pdf.free 5.1.0 version and javafx 13 correctly.

Before anyone can say that FreeSpire.PDF can't directly convert PDF files to Excel ones, I TRIED IT AT HOME AND IT WORKED, NOW THAT I'M AT MY JOB PLACE IT ISN'T WORKING. (I'm an Italian HighSchooler, sorry if i made some gramatical error or coding errors.)

djcbasio
 
Posts: 4
Joined: Thu Jul 07, 2022 9:46 am

Wed Jul 20, 2022 8:54 am

Hi,

Thanks for your inquiry.

Your code doesn't look wrong. Could you please provide us your test PDF file so we can reproduce this issue? Thanks for your assistance.
Sincerely,
Andy
E-iceblue support team
User avatar

Andy.Zhou
 
Posts: 483
Joined: Mon Mar 29, 2021 3:03 am

Wed Jul 20, 2022 9:10 am

There's the file, when I open the .xlsx it literally eliminates the columns where datas are written, so it displays a blank excel page.

djcbasio
 
Posts: 4
Joined: Thu Jul 07, 2022 9:46 am

Wed Jul 20, 2022 9:33 am

Hi,

Thanks for your sharing.

I have tested the file with the lastest commercial version of Spire.Pdf For Java v8.7.0 and it works fine. This maybe an issue in the free version. But I'm sorry that we only maintain the free version from time to time, and do not specifically provide fixes for the free version.
I can only recommend that you use the commercial version for testing. Sorry for the inconvenience and hope you can understand.
I have also attached the resulting xlsx file converted using the commercial version, maybe it will be of some use to you.
output.zip
Sincerely,
Andy
E-iceblue support team
User avatar

Andy.Zhou
 
Posts: 483
Joined: Mon Mar 29, 2021 3:03 am

Wed Jul 20, 2022 9:42 am

Thanks for your help, but I can't understand why at home my converted files are generated properly and here, at my job's place, it doesn't do that. I really did the EXACT same steps that i did at home yesterday. I also Copy-pasted the entire code and the entire .xml file to be sure about it. And it stil doesnt't work.

P.S: I have to mention that the files don't open in Microsoft Excel ONLY, because if I open them in Google sheets, they will open normally, showing me the datas (little bug of the rows width that I can solve manually in there).

djcbasio
 
Posts: 4
Joined: Thu Jul 07, 2022 9:46 am

Thu Jul 21, 2022 8:35 am

Hi,

I'm sorry for the inconvenience caused, but I really can't directly analyze the reason for the difference.
I still recommend that you use the latest commercial version. You can email to get a free one-month license. Maybe this can help you fix the problem temporarily.
If you need it, please send an email to sales@e-iceblue.com with the following information being included. Hope it can help you a little.

Product:
License Registered email address:
Sincerely,
Andy
E-iceblue support team
User avatar

Andy.Zhou
 
Posts: 483
Joined: Mon Mar 29, 2021 3:03 am

Fri Jul 22, 2022 7:26 am

Thanks for the advice, but as I say previously the free version WORKS. Excel files that are obtained through PDF files conversions with Free-Spire.PDF aren't showing their contents, saying that those are corrupted etc. I only want to know what can I do to read my files, knowing the fact that I use the EXACT same version of all the included programs on my work and home PC.

djcbasio
 
Posts: 4
Joined: Thu Jul 07, 2022 9:46 am

Return to Spire.PDF