Hello Aspose,
I’m evaluating aspose-cells-7.2.0.jar.
I’m trying to convert a MS 2003 xls to pdf format but I’m facing the following error during conversion:
Exception in thread “main” com.aspose.cells.CellsException: End of file reached.
at com.aspose.cells.yC.a(Unknown Source)
at com.aspose.cells.Workbook.a(Unknown Source)
at com.aspose.cells.Workbook.save(Unknown Source)
at com.aspose.cells.Workbook.save(Unknown Source)
at AsposeXLS.main(AsposeXLS.java:26)
Here’s the relevant java code:
Workbook workbook = new Workbook(“c:\temp\aspose\Book1.xls”);
workbook.save(“c:\temp\aspose\Book1.pdf”);
Please see the attached xls file.
Could you help with this problem?
Hi,
Workbook workbook = new Workbook(“E://book1.xls”);
Hello,
I tried:
import com.aspose.words.*;
import com.aspose.cells.Workbook;
public class AsposeXLS
{
public static void main(String[] args)
throws Exception
{
Workbook workbook = new Workbook(“C://temp//book1.xls”);
workbook.save(“C://temp//out.pdf”, SaveFormat.PDF);
}
}
Exception in thread “main” java.lang.IllegalStateException: End of file reached.
at java.lang.Throwable.(Throwable.java:67)
at com.aspose.cells.b.a.d.a.a(Unknown Source)
at com.aspose.cells.b.a.d.a.q(Unknown Source)
at com.aspose.cells.a.d.v.b(Unknown Source)
at com.aspose.cells.a.d.co.c(Unknown Source)
at com.aspose.cells.a.d.co.g(Unknown Source)
at com.aspose.cells.a.d.co.p(Unknown Source)
at
com.aspose.cells.a.d.co.
(Unknown Source)at com.aspose.cells.rd.a(Unknown Source)
at com.aspose.cells.Worksheet.autoFitRow(Unknown Source)
at com.aspose.cells.lY.a(Unknown Source)
at com.aspose.cells.gr.a(Unknown Source)
at com.aspose.cells.gr.C(Unknown Source)
at com.aspose.cells.gr.a(Unknown Source)
at com.aspose.cells.gq.a(Unknown Source)
at com.aspose.cells.Workbook.a(Unknown Source)
at com.aspose.cells.Workbook.save(Unknown Source)
at com.aspose.cells.Workbook.save(Unknown Source)
at AsposeXLS.main(AsposeXLS.java:29)
java version "1.6.0"
Java™ SE Runtime Environment (build pwi3260sr5ifix-20090623_01(SR5+151659+151951+151086+151619+151750+152177+152017+1
52507))
IBM J9 VM (build 2.4, J2RE 1.6.0 IBM J9 2.4 Windows XP x86-32 jvmwi3260sr5ifx-20090612_37149 (JIT enabled, AOT enabled)
J9VM - 20090612_037149_lHdSMr
JIT - r9_20090518_2017
GC - 20090417_AA)
JCL - 20090623_01
Please note that I succesfully tested Aspose.Words to convert DOC to PDF on my environment.
Problem happens only when using Aspose.Cells
Do you have any ideas?
Hi,
import com.aspose.cells.*;
Please let us know if we can be of any additional help to you.public class App1 {public static void main(String[] args) {// TODO code application logic heretry{Workbook workbook = new Workbook(“E://book1.xls”);workbook.save(“E://out.pdf”, SaveFormat.PDF);}catch(Exception e){}}}
Hello,
to exclude the JVM version I downloaded SUN JDK and made a test from outside Eclipse.
I tested everything from the command line.
I attached the full content of my test directory along with the batch file I use to compile and run the program. Aspose packages are included too. Here’s my output:
CLASSPATH
.;C:\Aspose\aspose-cells-7.2.0.jar;C:\Aspose\Aspose.Words.jdk16.jar;C:\Aspose\bcprov-jdk16-146.jar;C:\Aspose\dom4j-1.6.1
.jar;C:\Aspose\stax2-api-3.0.2.jar;C:\Aspose\woodstox-core-asl-4.1.1.jar
javac -version
javac 1.6.0_32
java -version
java version "1.6.0_32"
Java™ SE Runtime Environment (build 1.6.0_32-b05)
Java HotSpot™ Client VM (build 20.7-b02, mixed mode, sharing)
com.aspose.cells.CellsException: End of file reached.
at com.aspose.cells.yC.a(Unknown Source)
at com.aspose.cells.Workbook.a(Unknown Source)
at com.aspose.cells.Workbook.save(Unknown Source)
at com.aspose.cells.Workbook.save(Unknown Source)
at AsposeXLS.main(AsposeXLS.java:11)
Could you perform the same test on your machine from the command line?
Please see the attached archive.
Thx.
Hello,
there must be something strange on my Windows machine.
I tried the code on the target Linux machine and it works.
Please close the issue.
Hello,