After investigating our Aspose.Cells generated EMF file, Microsoft Excel generated EMF file and Microsoft Word generated PDF file, we find that it is the EMF plus records in the image that cause Microsoft Word treating the text in the image as paths/canvas.
Our Aspose.Cells generated EMF file and Microsoft Excel generated EMF file are both EmfPlusDual type. Our Aspose.Cells generated EMF file has EMF plus records like “EmfPlus-DrawString” record, but Microsoft Excel generated EMF file doesn’t have EMF plus records like “EmfPlus-DrawString” record and it uses “EmfPlus-GetDC” record to indicate that using the subsequent EMF only records.
Using the following code to remove EMF plus records, the generated EMF file will be Ok.
var book = new Workbook("test.xlsx");
Worksheet sheet = book.Worksheets;
var options = new ImageOrPrintOptions
ImageFormat = ImageFormat.Emf,
OnePagePerSheet = true,
using (MemoryStream ms = new MemoryStream())
new SheetRender(sheet, options).ToImage(0, ms);
//convert function code:
internal static void ReSaveImageToEmfOnly(Stream srcStream, String destPath)
Bitmap dummyBitmap = null;
Graphics dummyGfx = null;
IntPtr hdc = IntPtr.Zero;
System.Drawing.Imaging.Metafile metafile = null;
dummyBitmap = new Bitmap(1, 1);
dummyGfx = Graphics.FromImage(dummyBitmap);
hdc = dummyGfx.GetHdc();
Image srcImage = Image.FromStream(srcStream);
Rectangle rect = new Rectangle(0, 0, srcImage.Width, srcImage.Height);
metafile = new System.Drawing.Imaging.Metafile(destPath, hdc, rect, System.Drawing.Imaging.MetafileFrameUnit.Pixel, EmfType.EmfOnly);
Graphics graphic = Graphics.FromImage(metafile);
if (metafile != null)
if (hdc != IntPtr.Zero)
if (dummyGfx != null)
if (dummyBitmap != null)
Let us know if you still have any issue.