Xls and xlsx conversion to PDF hangs when inputstream is used

Hi,
I am using the below code from aspose cells jar to convert xls or xlsx to PDF. But I see that the process is hung and there is no exception either.
If I use a direct file, conversion is successful.
Also, I am not able to attach my sample excel file. It says the extension is not authorized

Can someone please help ?

Code:
Workbook workbook = new Workbook(is); //is is inputstream
workbook.save(“C:/temp/ImagetoPDF.pdf”);
return workbook;

@sushma1509,
Would you like to compress your original file into zip or 7z format? After compression, you can upload the compression package.

Hi @John.He
Have uploaded the compressed folder containing the sample

4030.7z (271.5 KB)

@sushma1509,

Which version of Aspose.Cells for Java API you are using? I tested your scenario/case using our latest version/fix: Aspose.Cells for Java v23.2 (Releases | Maven), it works fine and the output PDF (attached) is fine tuned. Here is the simple sample code that I am using:
e.g.
Sample code:

InputStream is = Files.newInputStream(Paths.get("f:\\files\\4030.xlsx"));
Workbook workbook = new Workbook(is); //is is inputstream
workbook.save("f:\\files\\ImagetoPDF.pdf");

ImagetoPDF.pdf (517.4 KB)

Please try latest version/fix and in case you still find any issue, let us know with details and sample code. We will check your issue soon.

Hi,

I am using version 19.9. Can you please check with that?
We will have to check if moving to latest is an option

@sushma1509,

We are sorry but we cannot evaluate or test issues with older version. Neither we could include fixes to older versions, the fixes are based on latest APIs set only. So, kindly try using latest version and let us know if you still find any issue.

Hi @amjad.sahi
I see a negative offset error when I try to convert excel to PDF . Stacktrace attached. Please let me know if I am missing something here.
java.io.IOException: Negative seek offset
at java.io.RandomAccessFile.seek(RandomAccessFile.java:555)
at ji.io.RandomAccessFileReadImpl.seekInternal(RandomAccessFileReadImpl.java:47)
at ji.io.jiFileReadAdaptor.seek(jiFileReadAdaptor.java:254)
at ji.io.jiBufferedInputStreamWrapper.skip(jiBufferedInputStreamWrapper.java:284)
at java.io.FilterInputStream.skip(FilterInputStream.java:151)
at com.aspose.cells.b.a.d.zi.g(Unknown Source)
at com.aspose.cells.zjq.b(Unknown Source)
at com.aspose.cells.zjq.a(Unknown Source)
at com.aspose.cells.Workbook.a(Unknown Source)
at com.aspose.cells.Workbook.(Unknown Source)

@sushma1509,

Are you using older version v19.9 or newer version (Aspose.Cells for Java v23.2)? As requested earlier, please try using latest version/fix and in case you still find the issue, kindly do provide your template Excel file (please zip the file prior attaching). We will check your issue soon.