Free Support Forum - aspose.com

Excel files failing to convert to PDF

Hi,


I’m evaluating Aspose and need to know why these files are failing to generate PDF’s. I have many examples of files that fail, these were a few samples which I know load and PDF through Excel but produce different errors.

Can you give me an idea why they might be failing or if they are just not supported.

Regards
Nick

Hi,

Thanks for your posting and using Aspose.Cells for Java.

They might be failing because of some bugs in Aspose.Cells for Java. Please download and try the latest version: Aspose.Cells for Java 7.4.1 and see if it resolves your issue.

If you still find a problem, then create separate thread for each of your xls file.

Let us know your feedback.

Hi,

Thanks for your posting and using Aspose.Cells for Java

With our latest fix(V7.4.1.3), your files "925f5768-1fa2-486c-aaf2-e25bbd2b8714.xls" and "3d402c1f-1ed0-4840-a132-76731e361f11.xls" can be converted to pdf files fine.

For other files, we have found some exceptions(most of them are OutOfMemoryError) when generating pdf file. We will look into those issues soon and update you when we have any news for them.

This issue has been logged as CELLSJAVA-40461.

Hi,


Thanks. I’ve updated to the latest release. I don’t get an error now from “925f5768-1fa2-486c-aaf2-e25bbd2b8714.xls”, but it produces an empty document. I’ve seen this happen for many other files. Do you know what might be going on there?

Also in regards to the files failing with “Shape to image Error”. This is by far the majority of errors I’m seeing.
com.aspose.cells.CellsException: Shape to image Error!
at com.aspose.cells.At.a(Unknown Source)
at com.aspose.cells.Workbook.a(Unknown Source)
at com.aspose.cells.Workbook.save(Unknown Source)
Looking on the forum people have been talking about this for over a year. It seems that its related to printing spreadsheets with graphs. Wouldn’t the same objects be shared between all office documents, and then you could leverage the code in Aspose.Slides to help out here? And when do you think you’ll have a fix for these?

Regards
Nick

Hi,

Thanks for your posting and using Aspose.Cells for Java.

We have converted the mentioned file using the latest version and it produced the correct output pdf file. I have attached the output pdf file for your reference.

For your newer issues, please create separate new threads. Please spare us some time, once the fix is available we will let you know asap.

Java
String filePath = “F:\Shak-Data-RW\Downloads\925f5768-1fa2-486c-aaf2-e25bbd2b8714.xls”;

Workbook workbook = new Workbook(filePath);

workbook.save(filePath + “.out.pdf”);

Hi,

I will create new requests for the other files as you asked.

I followed your code to the letter and it worked. However when I use the PDFSaveOptions it produces an empty document. Maybe I'm using it incorrectly. I was planing to change some of the settings in the options object, but if it doesn't work then I'll have to stick with whatever defaults are used.

Workbook workbook = new Workbook("925f5768-1fa2-486c-aaf2-e25bbd2b8714.xls");
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
pdfSaveOptions.setPrintingPageType(SaveFormat.PDF);
File pdfFile = File.createTempFile("out", ".pdf");
workbook.save(pdfFile.getAbsolutePath(), pdfSaveOptions);


Regards
Nick

Hi,

Thanks for your posting and using Aspose.Cells for Java.

Please use the code as shared by me earlier. It will create a correct output pdf. If you still get a problem, please let us know, we will look into your issue and help you asap.

Hi,


If I can’t use the PdfSaveOptions, how do I change settings such as zoom when generating the PDF. I would like to scale down or set the print area since the default options use quite a large font.

Since by not using PdfSaveOptions you can work around this issue please see this post which might be more relivant. Excel to PDF options

Regards
Nick
Hi,

Thanks for your posting and using Aspose.Cells.

Sure you can use PdfSaveOptions when generation pdf files. However, please set the correct value to options in your code. For your code of setting PrintingPageType, please use constants defined in PrintingPageType instead of the value of SaveFormat:
pdfSaveOptions.setPrintingPageType(PrintingPageType.DEFAULT);

Hi,


I am also trying to convert xlsx documents to pdf.
The following code creates a pdf file from the xls
String filename = “c:\test\new set of employees.xlsx”;
Workbook workbook = new Workbook(filename);
workbook.save(filename + “.out.pdf”);

But like the other poster mentioned i also want to use PdfSaveOptions.
and that produces an empty page.
code is used:
String filename = “c:\test\new set of employees.xlsx”;
Workbook workbook = new Workbook(filename);
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
pdfSaveOptions.setPrintingPageType(PrintingPageType.DEFAULT);
pdfSaveOptions.setPrintingPageType(SaveFormat.PDF);
File pdfFile = File.createTempFile(“out”, “.pdf”);
System.out.println("path: " + pdfFile.getAbsolutePath());
workbook.save(pdfFile.getAbsolutePath(), pdfSaveOptions);


Regards,

Jasper

Hi,

Thanks for your posting and using Aspose.Cells for Java.

Please provide the source xls/xlsx file which you are converting to pdf and that produces the empty page. We will look into your issue and help you asap.

Please create a separate thread. It will help us sort out your issue easily.

Hi,

Thanks for your posting and using Aspose.Cells for Java

You have reset the PrintingPageType to invalid value in your code:
pdfSaveOptions.setPrintingPageType(PrintingPageType.DEFAULT);
pdfSaveOptions.setPrintingPageType(SaveFormat.PDF);

So of course you cannot get the correct result. Please remove the second invocation of setPrintingPageType and try again.

removing the second entry, fixed the problem for me

Hi,


Thanks for your feedback.

Good to know that your issue is fixed now.

Feel free to contact us any time if you need further help or have some other query/issue. We will be happy to assist you .

Hi,


There has been a bit of talk in this thread after this issue was raised. I just wanted to confirm the OOM errors are still an issue for us.

Do you have any news on how its progressing?

Regards
Nick

Hi,

Thanks for your posting and using Aspose.Cells.

We have logged your comments against this issue. Once, we will have some update for you relating to it, we will share it with you asap.

Hi,

Thanks for your posting and using Aspose.Cells .

We have fixed the issue of OutOfMemoryError.Please download and try the latest version of Aspose.Cells for Java v 7.4.2.4. and let us know your feedback.

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


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan