Hi,
Our testing team has provided an Excel document that contains a column with a green background. When we publish this to PDF, we lose this background color. Is this a known issue or unsupported ? The document and the PDF result are attached. Here’s the conversion code, as well:
…
excel = New Aspose.Cells.Workbook
Using st As New IO.FileStream(Document.DownloadedSourcePath, IO.FileMode.Open, IO.FileAccess.Read)
If Document.IsOfficeXMLFormat Then
excel.Open(st, FileFormatType.Excel2007Xlsx)
Else
excel.Open(st)
End If
End Using
For Each ws As Worksheet In excel.Worksheets
ws.PageSetup.Orientation = PageOrientationType.Landscape
Next
excel.Save(XMLLoc(Document.DownloadedSourcePath), FileFormatType.AsposePdf)
oPdf = New Pdf
oPdf.TruetypeFontMapPath = ServerConfiguration.Settings.GetInstance.Transformations
oPdf.BindXML(XMLLoc(Document.DownloadedSourcePath), Nothing)
oPdf.Save(Document.OutputFolder & Constants.FILE_PUB_EXCEL2PDF)
Thanks!
Hi,
Thank you for considering Aspose.
Please attached your template and resultant files(your post is missing the attachments) and we will check your issue soon. Also, which version of Aspose.Cells are you using? Please try the latest version of Aspose.Cells from the following location: http://www.aspose.com/community/files/51/file-format-components/aspose.cells-for-.net-and-java/entry174461.aspx
Also, Aspose.Cells now support direct conversion of excel files to PDF. You don’t need to use Aspose.PDF any more for the conversion. Please see the following sample code in this regard,
Sample Code:
//Create Workbook Object
Workbook wb = new Workbook();
// Open the workbook
wb.Open("E:\\Hello_World.xls");
// Save Excel File as PDF
wb.Save("E:\\PDFTEST.pdf", FileFormatType.Pdf);
Thank You & Best Regards,
My apologies! Here are the files. It looks like the Aspose.Cells used was 4.5.0.0, so I’m downloading the current version now to test this scenario using our current method and the new direct conversion method. Thanks for pointing this out!
Hi,
Thank you for considering Aspose.
I have checked your file with the latest version and new direct conversion method and the issue of loosing background color is not occurring. Please check the attached output file. Please try the latest version and do let us know if you face any problem.
Thank You & Best Regards,
I’ve confirmed the issue is resolved in 4.7.1.0. Thanks for all your help, it’s greatly appreciated.