Excel to PDF conversion: lay-out problem


#1

Hi,

It’s my first time using the Aspose.Excel and Aspose.Pdf components. I’m using the evaluation versions for now.

I need to convert an Excel document to PDF and I noticed some problems:

  • Images included in the Excel are not in the generated PDF
  • Text with right alignment in cells are left aligned in PDF
  • Not all borders from the cells are in the PDF
Are this known issues or am I doing something wrong?

I open an Excel file, save it to AsposePdf xml format and then build a PDF from that xml.

Kind regards, Stief

#2

Dear Stief,

Thank you for considering Aspose.

I will contact the Aspose.Excel and then reply to you soon.


#3

Images are not supported in Xls2Pdf conversion. Please check http://www.aspose.com/wiki/default.aspx/Aspose.Excel/ConvertingToPdfFile.html .

For other two issues, could you post your file and sample code here? We will check it soon.


#4

I use this code to convert an Excel to PDF:

Excel excel = new Excel();
excel.Open(fileFullName);
excel.Save(tempXmlFile, FileFormatType.AsposePdf);

Pdf pdf = new Pdf();
pdf.TruetypeFontMapPath = saveLocation;
pdf.PageSetup.PageHeight = PageSize.A4Height;
pdf.PageSetup.PageWidth = PageSize.A4Width;
pdf.DestinationType = DestinationType.FitPage;

pdf.BindXML(tempXmlFile, null);
pdf.Save(saveLocation + fileName + “.pdf”);

You find the source Excel attached to this post. In the Excel document the word “Proefverslag” is aligned to the right but in the PDF it’s left aligned and part of it is lost because there is some other data in the cell beside it. Also the border below is not complete.

Is the support for images planned for future releases or not?

Thanks.
Stief