Hi, I am using the Aspose Cells 18.11.0 for a Demo to retreive the first sheet from an Excel Document and save it as a Pdf.
There are some images in the Excel file and those are not getting rendered correctly when the PDF gets generated. Please see attached image . The screenshot on the left is from Excel and screenshot on the right is generated pdf.
Excel Pdf conversion.jpg (535.1 KB)
I tried the Conversion by using Excel 2016(Save as Pdf) and I do not get the issue with the images when I use Excel 2016. Are there any Save options or some other properties from the workbook or the worksheet object I can use so that the images show correctly in the pdf?
I use the following code to create the pdf.
Workbook workbook = new Workbook(@"test.xlsx"); // Create an instance of PdfSaveOptions and pass SaveFormat to the constructor PdfSaveOptions options = new PdfSaveOptions(SaveFormat.Pdf); options.CreatedTime = DateTime.Now; // Save the workbook to PDF format while passing the object of PdfSaveOptions workbook.Save("aspose.pdf", options); Workbook excelWorkbook1 = new Workbook(); // Copy the first sheet of the first book into second book. excelWorkbook1.Worksheets.Copy(workbook.Worksheets); // Save the file. excelWorkbook1.Save("aspose sheet1.pdf", options);
Thank you for your help.