We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Error converting Excel file to PDF when executing in unix putty

Hi,

My codes are working corretly when testing it from my IDE in window OS however when we export it to Jar and execute it in unix putty, the process was killed due to failure in writing to user register stack - possible stack overflow.

Please see sample code snippet:

HSSFWorkbook tmpWorkbook = new HSSFWorkbook(“sample.xls”);

  License lic = null;
     lic = new License();
     lic.setLicense(Workbook.class.getClassLoader().getResourceAsStream(
        "Aspose.Cells.lic"));
     ByteArrayOutputStream tmpOutStr = new ByteArrayOutputStream();
     tmpWorkbook.write(tmpOutStr);
     ByteArrayInputStream tmpExcelInputStream =
        new ByteArrayInputStream(tmpOutStr.toByteArray());
     Workbook workbook;
     try {
        workbook = new Workbook(tmpExcelInputStream);
        workbook.save(tmpRuta.concat(aPreacuerdoVO.getNombfich()),
           SaveFormat.PDF);
        tmpExcelInputStream.close();
     } catch (Exception tmpExcp) {
        throw new BusinessException("Exception save excel");
        // Save the document in PDF format
     }

Hi,

Thanks for your posting and using Aspose.Cells.

Please download and try the latest version: Aspose.Cells for Java 8.5.2 and see if it makes any difference and resolves your issue. Mostly such issues are resolved with the latest version.

However, if your issue still occurs then please provide us source excel file used in the code and causing this exception. Please also provide us complete stack trace of the exception. We will look into your issue and help you asap.

julsfajardo:
Please see sample code snippet:

HSSFWorkbook tmpWorkbook = new HSSFWorkbook(“sample.xls”);

License lic = null;
lic = new License();
lic.setLicense(Workbook.class.getClassLoader().getResourceAsStream(
“Aspose.Cells.lic”));
ByteArrayOutputStream tmpOutStr = new ByteArrayOutputStream();
tmpWorkbook.write(tmpOutStr);
ByteArrayInputStream tmpExcelInputStream =
new ByteArrayInputStream(tmpOutStr.toByteArray());
Workbook workbook;
try {
workbook = new Workbook(tmpExcelInputStream);
workbook.save(tmpRuta.concat(aPreacuerdoVO.getNombfich()),
SaveFormat.PDF);
tmpExcelInputStream.close();
} catch (Exception tmpExcp) {
throw new BusinessException(“Exception save excel”);
// Save the document in PDF format
}