Completed
Last Updated: 15 Aug 2022 06:13 by ADMIN
Release R2 2020
Bertha
Created on: 19 Jul 2019 08:32
Category: PdfProcessing
Type: Feature Request
2
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;
}

1 comment
ADMIN
Dimitar
Posted on: 15 Aug 2022 06:13

Hello,

This item is for Net Framework, for Net Standard, there is another item: PdfProcessing: NetStandard: Add support for WMF/EMF images.

Regards,
Dimitar
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.