I’m using Gembox.Spreadsheet to convert excel files to PDF. I’ve recently come across an issue where pictures in an .xls spreadsheet are not being saved when converted to PDF.
public static void SpreadsheetToPDF(string filePath)
{
SetLicensing();
string newPath = System.IO.Path.ChangeExtension(filePath, ".pdf");
if (System.IO.File.Exists(newPath) && new System.IO.FileInfo(newPath).Length > 0)
{
return;
}
ExcelFile document = ExcelFile.Load(filePath);
var documentOptions = new GemBox.Spreadsheet.PdfSaveOptions()
{
ImageDpi = 330,
SelectionType = SelectionType.EntireFile,
RasterizeVectorPictures = true,
};
document.Save(newPath, documentOptions);
return;
}