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.

Fri Jun 26, 2020 12:31 pm

Hi experts,

I use spire.xls.free version 2.2.0 to convert xlsx document into pdf format, the function work well in local machine with OS windows or Mac OS,but when i deploy the function into centos server, the function got an error like this:
Code: Select all
class com.spire.xls.packages.sprFKC: Index is less than 0 or more than or equal to the list count.
Parameter name: index
Actual value was 0.
com.spire.ms.System.Collections.ArrayList.spr  (ArrayList.java:2654)
com.spire.ms.System.Collections.ArrayList.get_Item(ArrayList.java:2116)
com.spire.ms.System.Collections.ArrayList.get(ArrayList.java:2837)
com.spire.xls.packages.sprGhA.spr  (Unknown Source)
com.spire.xls.packages.sprViA.spr  (Unknown Source)
com.spire.xls.packages.sprViA.spr  (Unknown Source)
com.spire.xls.packages.sprViA.spr  (Unknown Source)
com.spire.xls.packages.sprViA.spr  (Unknown Source)
com.spire.xls.packages.sprViA.spr  (Unknown Source)
com.spire.xls.packages.sprViA.spr^B (Unknown Source)
com.spire.xls.packages.sprViA.spr  (Unknown Source)
com.spire.xls.packages.sprViA.spr  (Unknown Source)
com.spire.xls.packages.sprIpb.spr  (Unknown Source)
com.spire.xls.packages.sprDhA.spr^A (Unknown Source)
com.spire.xls.packages.sprDhA.spr  (Unknown Source)
com.spire.xls.core.spreadsheet.XlsWorkbook.spr^D (Unknown Source)
com.spire.xls.core.spreadsheet.XlsWorkbook.spr^D ^A (Unknown Source)
com.spire.xls.core.spreadsheet.XlsWorksheet.saveToPdf(Unknown Source)
com.sapfree.ordermanage.service.PDFService.generateInvoicePdf(PDFService.java:177)


My source code like this:
Code: Select all
            com.spire.xls.Workbook workbook = new com.spire.xls.Workbook();
            workbook.loadFromFile(originalExcelFile);
            workbook.getConverterSetting().setSheetFitToPage(true);
            com.spire.xls.Worksheet worksheet = workbook.getWorksheets().get(0);
            String pdfInvoiceFile = convertedFilePath+purchaseOrder.getNotes()+".pdf";
            worksheet.saveToPdf(pdfInvoiceFile);


has anyone encountered the same error before ? or can anyone give some suggestion why this issue happened ?
Thanks very much!

majunhai
 
Posts: 3
Joined: Fri Jun 26, 2020 12:20 pm

Fri Jun 26, 2020 2:04 pm

Hi all
I've resolved this error since i found there's a similar post before, then i follow the suggestion from rachel.lei, install chinese font package in centos, then the error disappeared!

majunhai
 
Posts: 3
Joined: Fri Jun 26, 2020 12:20 pm

Mon Jun 29, 2020 1:29 am

Hello,

Glad to hear that your issue has been resolved.
If you have further questions, please feel free to let us know.
Wish you all the best!

Sincerely,
Rachel
E-iceblue support team
User avatar

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

Fri Jul 31, 2020 1:38 pm

majunhai wrote:Hi all
I've resolved this error since i found there's a similar post before, then i follow the suggestion from rachel.lei, install chinese font package in centos, then the error disappeared!


hi, can you tell me, what's your install chinese font package ,I also have problems with modification,Thank's

smniuhe123
 
Posts: 2
Joined: Fri Jul 31, 2020 1:29 pm

Fri Jul 31, 2020 1:40 pm

rachel.lei wrote:Hello,

Glad to hear that your issue has been resolved.
If you have further questions, please feel free to let us know.
Wish you all the best!

Sincerely,
Rachel
E-iceblue support team



hi, can you tell me, what's your install chinese font package ,I also have problems with modification,Thank's

smniuhe123
 
Posts: 2
Joined: Fri Jul 31, 2020 1:29 pm

Mon Aug 03, 2020 6:41 am

Hi,

Thanks for your inquiry.
When doing the conversion from Excel to PDF, our Spire.XLS will find the used fonts in system. Please make sure that all fonts used in your Excel are installed in your Centos. I also suggest that you restart your server for the font to take effect. Besides, if you were using the free version, I suggest that you download the latest(Spire.XLS for Java Version:3.7.5)to test again, since the latest version contains more fixes and new features, it is more stable than the free one. If the issue still happens on your side, please provide your Excel file as well as your server information such as Centos 7 for further investigation.

Sincerely,
Lynn
E-iceblue support team
User avatar

lynn.zhang
 
Posts: 57
Joined: Mon Jul 27, 2020 2:27 am

Mon Aug 10, 2020 11:31 am

Hi,

Greetings from E-iceblue.
How's your issue doing? Could you please give us some feedback at your convenience?

Sincerely,
Lynn
E-iceblue support team
User avatar

lynn.zhang
 
Posts: 57
Joined: Mon Jul 27, 2020 2:27 am

Return to Spire.XLS