We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Multiples Images in mail merge

Hi I have a doubt, How I can use this
document.MailMerge.MergeImageField += new MergeImageFieldEventHandler(MergeField_ProductImage);

but with multiple {MERGEFIELD Image:barcode \*MERGEFORMAT} in my mail merge document, because just read the first image

Thanks in advance

3 Replies

SY Sethumanikkam Yogendran Syncfusion Team December 14, 2016 08:08 AM UTC

Hi Jaime,

Thank you for contacting Syncfusion support.

DocIO provides support to merge multiple images for multiple merge fields. Each merge field can be replaced with different image. Please find the following UG documentation link for merging multiple images.

UG documentation link:
https://help.syncfusion.com/file-formats/docio/working-with-mailmerge
https://help.syncfusion.com/file-formats/docio/working-with-mailmerge#event-support-for-mail-merge

Online sample link:
http://mvc.syncfusion.com/demos/web/docio/employeereport

On analyzing further on your requirement, we suspect that the image name is not modified when each mail merge event is triggered based on the merge field and so you may get the same image for all the merge fields. The merge field value should match the image name to get correct results. Please find the following code snippets or your reference.
 
private void MergeField_ProductImage(object sender, MergeImageFieldEventArgs args) 
{ 
    // Get the image from disk during Merge. 
    if (args.FieldName == "ProductImage") 
    { 
        string ProductFileName = args.FieldValue.ToString(); 
        args.Image = Image.FromFile(Path.Combine(@"..\..\..\..\..\..\..\..\Common\images\DocIO\", ProductFileName)); 
    } 
} 

If we misunderstood any of your requirement, then please elaborate your exact requirement with the code snippets used, expected output document and screenshot. Thereby we will analyze further and update you the appropriate details at the earliest.

Please let us know if you have any other questions.

Thanks,
Sethumanikkam.Y



JA jaime December 30, 2016 11:49 PM UTC

Thanks for your reply, I have an image overlapping with another image that was the reason because my mail merge didn't works

Thanks for your support


VR Vijay Ramachandran Syncfusion Team January 2, 2017 07:29 AM UTC

Hi Jaime,

Thank you for your update.

We are unable to understand your exact requirement or issue you are facing with the given details. So kindly provide us the following details, thereby we will analyze further and update you the appropriate solution at the earliest.

   1. Working scenario along with sample or code snippet used at your end.
   2. Input template document, images used.
   3. Data set used.
   4. Expected output screen shot.

Let us know if you have any concern.

Regards,
Vijay R


Loader.
Live Chat Icon For mobile
Up arrow icon