Apspose.Cells for Java save as PDF

Is it possible to use aspose.cells for java to save an spreadsheet as pdf? In the documentation of the FileFormatType (Aspose.Total Product Family) the PDF format is not listed.


This message was posted using Page2Forum from FileFormatType (Aspose.Cells for Java API Specification) - Aspose.Cells for .NET and Java

Hi,

Well, you have to save an intermediate xml file (ASPOSE_PDF) using Aspose.Cells for Java and then use Aspose.Pdf for Java APIs to save the Pdf file from the xml file.

See the following document link for your reference:

http://www.aspose.com/documentation/file-format-components/aspose.cells-for-.net-and-java/converting-to-pdf-files-java.html

Thank you.

Hi,
I’m having problems saving some aspose.cells workbooks to the ASPOSE_PDF format.
When running the following code (The excel was created earlier with apose.cells):

import java.io.IOException;
import com.aspose.cells.;
import com.aspose.pdf.elements.
;
import com.aspose.pdf.exception.AsposeBaseException;

public class convert
{
public static void main(String[] args) throws Exception
{
Workbook workbook = new Workbook();
workbook.open(“excel2000.xls”);
workbook.save(“asposepdf.xml”, FileFormatType.ASPOSE_PDF);
}
}


I receive the following exceptions
Exception in thread “main” java.lang.NullPointerException
at com.aspose.cells.bk.a(Unknown Source)
at com.aspose.cells.aF.a(Unknown Source)
at com.aspose.cells.am.a(Unknown Source)
at com.aspose.cells.am.a(Unknown Source)
at com.aspose.cells.am.a(Unknown Source)
at com.aspose.cells.am.a(Unknown Source)
at com.aspose.cells.am.c(Unknown Source)
at com.aspose.cells.am.b(Unknown Source)
at com.aspose.cells.am.b(Unknown Source)
at com.aspose.cells.am.a(Unknown Source)
at com.aspose.cells.am.a(Unknown Source)
at com.aspose.cells.am.a(Unknown Source)
at com.aspose.cells.Workbook.save(Unknown Source)
at convert.main(convert.java:17)

Please advise.

Hi,

Thank you for sharing your template file.

We have found your mentioned issue after an initial test. We will fix it and get back to you soon.

Thank You & Best Regards,

I found a workaround for the exceptions. It has something to do with styles. If I do a cell.setStyle(cell.getStyle()) for each cell I use, it works just fine.

Hi,

Thank you for considering Aspose.

Please try the attached latest version of Aspose.Cells. We have fixed your mentioned issue.

Thank You & Best Regards,

The issues you have found earlier (filed as 9265) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.