Approved
Last Updated: 19 Jul 2019 08:36 by ADMIN
Bertha
Created on: 19 Jul 2019 08:32
Category: PdfProcessing
Type: Feature Request
1
PdfProcessing: Add support for WMF/EMF images
Support for exporting WMF (Windows Metafile) and EMF (Enhanced Metafile) images should be implemented.

Workaround: Convert the WMF images to PNG before exporting:
ImageSource imageSource = new ImageSource(new MemoryStream(this.ConvertWmfImageToPng(stream)));
document.Pages.AddPage().Content.AddImage(imageSource);
...
private byte[] ConvertWmfImageToPng(Stream wmfImageStream)
{
    byte[] pngBytes;
 
    using (MemoryStream pngImageStream = new MemoryStream())
    {
        System.Drawing.Image imageDrawing = System.Drawing.Image.FromStream(wmfImageStream);
        imageDrawing.Save(pngImageStream, System.Drawing.Imaging.ImageFormat.Png);
        pngBytes = pngImageStream.ToArray();
    }
 
    return pngBytes;
}

0 comments