XLS Pictures Not Included in PDF

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;
        }

Can you please send us your XLS file so that we can reproduce this issue and investigate it?

Hi Mario,

I just sent XLS file via email. Thank you for looking into this.

Jamey

Hi Jamey,

Unfortunately, the problem occurs because those images are of EMF format.

Currently, EMF and WMF images are not supported in XLS format.
Are you able to change the format of those images, or change the format of the input file to XLSX?

Regards,
Mario