Problem with default paper size

Hello,

I’m using Aspose.Cells 7.0.1.5, and I’m noticing a problem with the default paper size when loading an xml file.

I have an Excel file (File.xls) with paper size set to Letter. I saved this as Spreadsheet XML (File.xml) and there is no paper size specified. I guess Excel considers Letter to be the default. When I open this file in Excel, it correctly shows Letter. But when I load this file into Aspose, it sets the paper size to A4. This is causing problems with proper creation of PDF files.

Since my process involves getting an XML file from Excel/OWC, then using Aspose to convert to PDF, there appears to be no way for me to work with Letter size documents. Excel will not write out the setting, but Aspose assumes A4 when there is no setting. Do you have any suggestions?

Here is the code that produced the attached files, illustrating the problem.



[Test]

public void OpenXlsAndSaveAsPdfOutputIsCorrect()

{

var test = string.Format(@"{0}\File.xls", TestHelper.InputDirectory);

var workbook = new Workbook(test, new LoadOptions(LoadFormat.Excel97To2003));

workbook.Save(test + “.xml”, SaveFormat.SpreadsheetML); //here you see paper size is 1 (letter)

workbook.Save(test + “.pdf”, SaveFormat.Pdf); //here you see report correctly takes one page

}

[Test]
public void OpenXmlAndSaveAsPdfOutputIsNotCorrect()
{
var test = string.Format(@"{0}\File.xml", TestHelper.InputDirectory);
var workbook = new Workbook(test, new LoadOptions(LoadFormat.SpreadsheetML));
workbook.Save(test + “.xls”, SaveFormat.Excel97To2003); //here you see paper size is A4
workbook.Save(test + “.xml”, SaveFormat.SpreadsheetML); //here you see paper size is 9 (A4)
workbook.Save(test + “.pdf”, SaveFormat.Pdf); //here you see report takes two pages instead of one
}



Hi,


Thanks for the files with details.

I can see the issue as you mentioned using your code and sample files. The saved as XLS and PDF from XML have two pages and their paper size is changed. I have logged a ticket with an id: CELLSNET-40066. We will look into to figure it out soon.

Thank you.

Hi,.

Please download and try the latest fix: Aspose.Cells for .NET v7.0.4.5

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


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