Hi Bee,
Thank you for your interest in Syncfusion
product.
Currently we do not support PNG images,
however we have added a feature request to implement this feature in any our
upcoming release. We will let you know once the feature has been implemented.
Please let us know if you have any
questions.
Regards,
George
I ran into this same issue. Your documentation is misleading because the first example implies its using a PNG image
http://help.syncfusion.com/UG/winrt/default.htm#!Documents/drawingimages.htm
//Draw bitmage image with image size
PdfImage image = new PdfBitmap(pngImage);
g.DrawImage(image, 0, 0, image.Width, image.Height);
using System; using System.Collections.Generic; using System.IO; using System.Threading.Tasks; using Syncfusion.Pdf.Graphics; using Windows.Graphics.Imaging; using Windows.Storage; using Windows.Storage.Streams; namespace Relay.Forms.UI.Utils { public static class IStorageFileExtensions { public static async Task<PdfImage> ToPdfImage(this IStorageFile file) { using (var fileStream = await file.OpenReadAsync()) { IRandomAccessStream stream; if (file.ContentType == "image/png") { var decoder = await BitmapDecoder.CreateAsync(fileStream); var pixels = await decoder.GetPixelDataAsync(); stream = new InMemoryRandomAccessStream(); var encoder = await BitmapEncoder.CreateAsync(BitmapEncoder.JpegEncoderId, stream); encoder.SetPixelData(decoder.BitmapPixelFormat, BitmapAlphaMode.Ignore, decoder.OrientedPixelWidth, decoder.OrientedPixelHeight, decoder.DpiX, decoder.DpiY, pixels.DetachPixelData()); await encoder.FlushAsync(); } else { stream = fileStream; } PdfImage image = PdfImage.FromStream(stream.AsStream()); return image; } } } }
Simply call this on your PNG image and it will work fine
IStorageFile fileImage = ...
PdfImage image = await fileImage.ToPdfImage();