Xls to PDF conversion in Solaris Environment

Hi,

I'm using the Aspose software for converting the xls to PDF. I'm using the following code and it's working fine at Windows and in Solaris, it is genarated the pdf file with 0 bytes size.

Workbook workbook = new Workbook();
workbook.open(excelFilePath);
workbook.save(pdfFilePath, FileFormatType.PDF);

Regards,

Dheeraj

Hi,

Could you post your input Excel file here, we will check it soon.
And, which version you are using? do you get some error when saving to PDF format on Solaris?
Thank you.

Hi,

I'm using the aspose.cells_2.3.1_20100716.jar and Jdk1.5 version. The below mentioned code is working fine at Windows Environment. When i run the same code at Solaris environment, it is not throwing any exception but PDF file generating with 0 bytes.

Workbook workbook = new Workbook();
workbook.open("c:\\test.xls");
workbook.save("c\\test.pdf", FileFormatType.PDF);

Regards,

Dheeraj

Hi,

Could you give us your test.xls file here, we will check your issue on Solaris environment soon.

Thank you.

Hi Amjad,

Tested xml file is attached.

Regards,

Dheeraj

Hi Dheeraj,

This issue is because of missing fonts. There are different fonts used in the excel file. Those fonts are missing in Solaris environment. This issue can be removed by copying all needed fonts file from Windows operating system to Solaris operating system and then setting the font path in the code.

Following line of code can be used to set the font path:

Workbook.getSaveOption().setFontPath(String[])

Thanks,

Hi Shakeel,

Thanks for quick response.

Workbook.getSaveOption().setFontPath(String[]) , what should pass in the String array. it is font locations in String array? Where can i download the Microsftfonts or how can i move it from windows to Solaris. This is very urgent. I have to show the demo to clients today.

Regards,

Dheeraj

Hi Dheeraj,

Using some portable device, simple copy the font files from Windows operating system i.e. “C:\WINDOWS\Fonts\” to Linux operating system on path “/home/usr/test/winfont”.

Now pass this path as string to method mentioned below:

Workbook.getSaveOptions().setFontPath(new String[]{"/home/usr/test/winfont"});

Thanks,

Hi Dheeraj,

Please use the updated version Aspose.CellsV2.4.0.1.zip attached. The enhancement has been made that if the needed font files are not found while generting the PDF, the default font files of JRE will be used. We hope that this will fit into your requirment.

Thanks,