Free Support Forum - aspose.com

Excel document is slipping while saving as pdf

Hi,
The excel document is slipping while saving as pdf. Docs has attached.

docs.zip (430.6 KB)

@srmbimser

Thanks for using Aspose APIs.

We were able to observe this issue and logged it in our database for investigation and for a fix. Once, the issue is resolved or we have some other news for you, we will let you know in this topic asap.

This issue has been logged as

  • CELLSNET-46126 - Excel document is slipping while saving as Pdf

C#

LoadOptions opts = new LoadOptions(LoadFormat.Excel97To2003);
opts.SetPaperSize(PaperSizeType.PaperA4);

AutoFitterOptions af = new AutoFitterOptions();
af.OnlyAuto = true;

opts.AutoFitterOptions = af;

Workbook wb = new Workbook("1534_17.xls", opts);
wb.Save("output.pdf");

Thanks for reply,

We can not use the code you sent. Because our customers are able to give different sizes to the documents.
Thanks.

@srmbimser

Regardless of the code, we were able to replicate the issue and we will work on it to fix it. Thank you and have a good day.

@srmbimser

Thanks for using Aspose APIs.

We are not sure about your issue. What do you mean when you say, the Excel document is slipping.

However, we found that Excel Pdf has 10 pages and Aspose.Cells Pdf has 11 pages. Is this the issue you are referring to? Please confirm.

Yes. This is our problem.
Thanks

@srmbimser,

If you open your Excel document into MS Excel 2003/2007 and take the print preview of the sheet, you will find that it also renders 11 pages. Generally we follow MS Excel 2003 standards for XLS file format (only) when rendering XLS to PDF. Your issue is still open and we will evaluate it thoroughly if we can fix it for your needs.

After we saved the document as xlsx, the problem did not change when we converted it to PDF with Aspose.
Thanks

@srmbimser,

I mean if you could open your file into MS Excel 2003/2007 and re-save to PDF file format, you will also get 11 pages (same result as Aspose.Cells renders), so it is an issue that different MS Excel versions behaves differently. Anyways, please spare us little time, we will evaluate your issue and update you.

@srmbimser

Thanks for using Aspose APIs.

This is to inform you that we have fixed your issue CELLSNET-46126 now. We will soon provide the fix after performing QA and including other enhancements and fixes.

@srmbimser

Thanks for using Aspose APIs.

Please download and try the following fix for your issue CELLSNET-46126 and let us know your feedback.

The issues you have found earlier (filed as CELLSNET-46126) have been fixed in Aspose.Cells for .NET 18.6. Please also check the document/article for your reference: https://docs.aspose.com/display/cellsnet/Installation