Only able to MailMerge Images from within assembly ...

This works (with image set as embedded resource): 

var assembly = Assembly.GetExecutingAssembly();

Stream imageStream = assembly.GetManifestResourceStream("Application.Images.Logo.png");
args.ImageStream = imageStream;
WPicture picture = args.Picture;

picture.Height = 32;
picture.Width = 124;

This does not(the image does not show):

var picker = new FileOpenPicker();
picker.ViewMode = PickerViewMode.Thumbnail;
picker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
picker.FileTypeFilter.Add(".jpg");

StorageFile file = await picker.PickSingleFileAsync();
var imageStream = await file.OpenStreamForReadAsync();
args.ImageStream = imageStream;
WPicture picture = args.Picture;
picture.Height = 32;
picture.Width = 64;



Can you please provide a sample where I can mail merge an image that is not part of the assembly into a word document. Thank you in advance


Mike


1 Reply

MR Manikandan Ravichandran Syncfusion Team October 6, 2021 11:26 AM UTC

Hi Mike,

Thank you for contacting Syncfusion support.

From the given details, we have found that your requirement is to insert the image into merge field and that image should get from file picker instead of embedding into the application. Based on this, we have prepared the simple sample in UWP platform and it can be download from the below link.
https://www.syncfusion.com/downloads/support/forum/169427/ze/UWPSample_F169427-1209039554

Please let us know if you have any other queries.

Regards,
Manikandan Ravichandran 


Loader.
Up arrow icon