The current implementation uses System.Windows.Media.Imaging.BitmapImage class in order to take the image pixels for the PDF export. However, BitmapImage class throws NotSupportedException when being initialized with a WMF or EMF image. WORKAROUND: WMF and EMF images may be converted to PNG images before the PDF export. The following code snippet shows how to convert all inline WMF image to PNG images by using System.Drawing.Image class:private
static
void
ConvertInlineWmfImagesToPng(RadFlowDocument document)
{
foreach
(ImageInline image
in
document.EnumerateChildrenOfType<ImageInline>())
{
if
(image.Image.ImageSource.Extension.Equals(
"wmf"
, StringComparison.InvariantCultureIgnoreCase))
{
using
(MemoryStream wmfImageStream =
new
MemoryStream(image.Image.ImageSource.Data))
{
using
(MemoryStream pngImageStream =
new
MemoryStream())
{
var imageDrawing = System.Drawing.Image.FromStream(wmfImageStream);
imageDrawing.Save(pngImageStream, ImageFormat.Png);
byte
[] pngBytes = pngImageStream.ToArray();
image.Image.ImageSource =
new
ImageSource(pngBytes,
"png"
);
}
}
}
}
}