Export worksheet as WMF/EMF

Is there a way to export worksheet as WMF or EMF metafile?

Thanks a lot for help

Ota

Hi Ota,

You can save the Excel file as Windows Media Photo (WMP), see the Supported Image Formats.

For example:

var workbook = ExcelFile.Load("input.xlsx");

var worksheet = workbook.Worksheets.ActiveWorksheet;
worksheet.PrintOptions.FitWorksheetWidthToPages = 1;
worksheet.PrintOptions.FitWorksheetHeightToPages = 1;

var options = new ImageSaveOptions(ImageSaveFormat.Wmp);
workbook.Save("output.wdp", options);

Does this work for you?

Regards,
Mario

Unfortunatelly not, because it seems to me that Windows Media Photo is a raster format, but I need a vector one. So I guess I can use only PDF.

Ota

Hi Ote,

Yes I’m afraid that GemBox.Spreadsheet currently supports only loading vector images and creating ExcelPicture elements from them.
In other words, you can import EMF, WMF, and SVG images into your spreadsheet.
But unfortunately, saving the spreadsheet to those formats is not supported for now.

Regards,
Mario