Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Mon Jun 15, 2020 4:43 pm

Hi, I want to converting excel to pdf file .
but, on the linux (server) can't export when call saveToStream

Code: Select all
InputStream input = new URL("https://mydomain.com/Report/template.xls").openStream();
Workbook workbook = new Workbook();
workbook.loadFromStream(input);

ByteArrayOutputStream baos = new ByteArrayOutputStream();
workbook.saveToStream(baos, FileFormat.PDF);


so, error exception is
"Index is less than 0 or more than or equal to the list count.
Parameter name: index
Actual value was 0."


By chance anyone of you have already experienced this issue?
Thanks in advance.

25novtua
 
Posts: 2
Joined: Mon Jun 15, 2020 3:52 pm

Tue Jun 16, 2020 1:51 am

Hello,

Thanks for your inquiry.
Kindly note that when using our Spire.XLS to convert Excel file to PDF on Linux, you need to first install all the fonts used in the Excel file on your system. Please install the corresponding fonts and try again.
If the issue still occurs, please provide your input file and your OS information (E.g. CentOS 7, 64bit) to help us investigate further. Thanks in advance.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Tue Jun 16, 2020 4:48 am

Thanks for your help rachel.lei.
I already to in install all the fonts of Microsoft font packages.
But, Function saveToStream() is still same error.

"Index is less than 0 or more than or equal to the list count.
Parameter name: index
Actual value was 0."



Other information as belows :
OS Version
Image

Spire.XLS.free Version 2.2.0
Attachments
Book1.zip
My Input File
(6.96 KiB) Downloaded 164 times

25novtua
 
Posts: 2
Joined: Mon Jun 15, 2020 3:52 pm

Tue Jun 16, 2020 8:36 am

Hello,

Thanks for your sharing.
I tested you file with Free Spire.XLS V2.2.0 and the latest commercial version Spire.XLS for Java Version:3.5.7, but did not encounter any issue. Here I uploaded my executable .jar file for your reference, please run it directly on your side and then tell us your test results.
http://www.e-iceblue.com/downloads/demo/21886Demo.zip
If the issue still occurs, please tell us the JDK version you are using and the download link of your Linux system installation package for further investigation.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Return to Spire.XLS