I have an excel document that I want to convert to PDF. The document prints out as 1 page in excel, I'd like for it to do the same once converted. The content ends up taking up only a quarter of the first page of the PDF. What am I doing wrong?
Here's the code I use:
Workbook wb1 = new Workbook();
wb1.Open("FILE.XLS");
MemoryStream stream = new MemoryStream();
wb1.Save(stream, FileFormatType.AsposePdf);
stream.Seek(0, SeekOrigin.Begin);
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(stream);
Aspose.Pdf.Pdf pdf = new Aspose.Pdf.Pdf();
pdf.PageSetup.PageHeight = PageSize.A4Height;
pdf.PageSetup.PageWidth = PageSize.A4Width;
pdf.DestinationType = DestinationType.FitPage;
pdf.BindXML(xmlDoc, null);
pdf.Save("Test.PDF", Aspose.Pdf.SaveType.OpenInBrowser,Response);
I've attached the resulting PDF.