How to set image size for mail merge?

Hi,

I was looking in the documentation, but I really cannot find this: is there a way to specify in the merge field the size in pixels to use for the image, possibly with auto-scaling?

Thanks.

@mtassinari

Thanks for your inquiry. Please check following sample code snippet to resize the image in Mail Merge. Hopefully it will help you to accomplish the task.

/// Image Mail Megre
/// </summary>

public class MergeImageFieldResizeImage : IFieldMergingCallback
{
    void IFieldMergingCallback.FieldMerging(FieldMergingArgs args)
    {
        // Do nothing.
    }

    void IFieldMergingCallback.ImageFieldMerging(ImageFieldMergingArgs e)
    {
        // Create DocuemntBuilder and move its cursor to the mergefield
        DocumentBuilder builder = new DocumentBuilder(e.Document);
        builder.MoveToField(e.Field, true);

        // Insert image and specify its size
        builder.InsertImage((byte[])e.FieldValue,ConvertUtil.PixelToPoint(300), ConvertUtil.PixelToPoint(300));
        e.Field.Remove();
    }
}

Thanks for your answer, but that is not what I am looking for, since I do not want to do that programmatically, but specify the size in the template itself.

In the end I found the article on your blog which explains how to do it: Lock Fields in Word Documents Programmatically in C#. NET and Java

I was looking for this in the docs, but it is not there, it could be useful to integrate this information!

@mtassinari

Thanks for your feedback. It is good to know that you have found your required information, to specify image size within template. Sure, we will double check it and will add this information in documentation accordingly.