Free Support Forum - aspose.com

ODS will not convert into PDF correctly

Hello.

I have created an ODS dynamically from a data source in a Java application.

I’m using Aspose.Cells to convert the ODS into a PDF.

The Spreadsheet is displayed correctly when I open it with Libreoffice.
The problem is that when it’s converted to PDF, every cell which has formulas, are not correctly displayed. Some cells are also not correct.

How to fix it? I’m using the latest version (~15 May 2015, (8.4.2 I think))

I have attached the sample ODS.

·············

Conversion code:

public void guardarComoPDF(String facturaGuardada) throws Exception
{
//Instantiate a new workbook with Excel file path
Workbook workbook = new Workbook(facturaGuardada);

//Save the document in PDF format
String facturaGuardadaPDF = facturaGuardada.replaceAll("\.ods", “.pdf”);
workbook.save(facturaGuardadaPDF, SaveFormat.PDF);
}

············

Thanks

Hi,

Thanks for your posting and using Aspose.Cells.

Please download and try the latest version: Aspose.Cells
for Java v8.4.2.5
it works fine.

I have converted your ods file into pdf using the following code and it generated the correct pdf. I have attached the output pdf for your reference.

If you still find any issue, please highlight your issues in a screenshot with red circles. Please note that Aspose.Cells generates pdf as Microsoft Excel shows it in Print Preview.

Java


//Instantiate a new workbook with Excel file path

Workbook workbook = new Workbook(“invoice.ods”);


//Save the document in PDF format

workbook.save(“output.pdf”, SaveFormat.PDF);

It is still not converting it.

I have created a standalone program in order to convert it directly.

I have attached code and output pdf screenshot.


Hi,

Thanks for your screenshot and using Aspose.Cells.

We were able to observe this issue and found cells with formulas are displayed inside the PDF while they are not displayed inside the ODS as shown in your screenshot.

We have logged this issue in our database for investigation along with your comment. We will look into it and fix this issue. Once, the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as

  • CELLSJAVA-41360 - Cells with formulas are displayed inside the PDF while they are not displayed inside the ODS

Actually, formulas are not displayed. Instead, formulas are not rendered/processed correctly.

Hi,

Thanks for your posting and using Aspose.Cells.

Please call Workbook.calculateFormula() before saving to pdf and see if it resolves your issue. Please see the following sample code.

Java


//Instantiate a new workbook with Excel file path

Workbook workbook = new Workbook(“invoice.ods”);


workbook.calculateFormula();


//Save the document in PDF format

workbook.save(“output.pdf”, SaveFormat.PDF);

Thank you.

Formulas are being processed correctly now.

There is still one minor problem, I have attached the output PDF. There is one column which is not yet displayed as in your output PDF.

Hi Jesus,


I have generated the PDF from your provided ODS file while using the latest version of Aspose.Cells for Java 8.4.2.5. I am afraid, I am unable replicate the problem as shown in your provided screenshot. Please check the resultant PDF and snapshot for your reference.

Could you please output the API version using the CellsHelper.getVersion() just to make sure you are using the latest version?

Output of CellsHelper.getVersion()
8.4.2.5

In the Libreoffice’s spreadsheet preview, it is correctly rendered.

Hi,

Thanks for your feedback and using Aspose.Cells.

Are you using Linux or Windows? Please let us know your OS and System Environment so that we try to replicate this issue in the similar environment.

Hi,

Thanks for using Aspose.Cells.

We have evaluated this issue CELLSJAVA-41360 and found that it’s caused by that Aspose.Cells does not support conditional formatting that there are many extra " 0.00 €" in the range “B15:I18”.

I am running Debian 7.8 (oldstable) developing under Eclipse with OpenJDK 7.

Hi,

Thanks for your posting and using Aspose.Cells.

We have already evaluated this issue. Please see out comment in the above post.

@jesus92gz,

This is to inform you that we have fixed your issues (logged earlier as “CELLSJAVA-41360") now. We will soon provide you the fixed version after performing QA and incorporating other enhancements and fixes.

The issues you have found earlier (filed as CELLSJAVA-41360) have been fixed in Aspose.Cells for Java v20.1. This message was posted using Bugs notification tool by ahsaniqbalsidiqui