I’m using aspose pdf version 3.9.0.0 and am having a few issues converting an xls file to pdf. When the conversion is run on my local machine running windows 8, the conversion runs as expected, however when it is run on Windows Server 2003 R2 it appears that the conversion is increasing the width of the columns, as instead of taking up 2 pages, it takes up 4. (See attached files)
The code used to convert the file to pdf is shown below. Could anyone let me know as to why the conversion performs differently on a server, and a local machine? Thanks.
protected void ConvertToPdf(Workbook workbook, string filename) {
// Save the document in the Aspose.Pdf.Xml format.
string xmlFile = filename.Replace(".xls", “.xml”);
MemoryStream stream = new MemoryStream();
workbook.Save(stream, FileFormatType.AsposePdf);
// Read the document into Aspose.Pdf
Aspose.Pdf.Pdf pdf = new Aspose.Pdf.Pdf();
pdf.BindXML(stream, null);
pdf.IsImagesInXmlDeleteNeeded = true;
pdf.IsTruetypeFontMapCached = true;
pdf.TruetypeFontMapPath = Path.GetTempPath();
string pdfFileName = filename.Replace(".xls", “.pdf”);
pdf.Save(pdfFileName);
try {
stream.Close();
}
catch {
}
}
Hi,