facebooktwittermenuarrow-up

GemBox Support Forum

Mail merge picture size

Hi,

I’m using the mailmerge feature of Gembox.Document to produce reports.
I’m having issues with the sizing of a picture.

I have created a merge field inside a table cell, and I would like the picture to occupy the maximum of the cell size without changing its aspect ratio.

For now, it’s inserting the picture, but the ratio is all messed up.

I’ve read in the help page that I could put a shape my merge field but after many attempts, I don’t know how to do it, when I try to draw the shape in my word template, it doesn’t go inside my merge field.

Can anybody help me with this? Either not to fix the aspect ratio, or how to use the shape…

Cheers

Hi Nicolas,

You can drag your placeholder shape into the field. For example, try following these steps:

  1. Add MERGEFIELD element:
    add-merge-field
  2. Add shape element:
    add-shape
  3. Drag&drop shape into the field:
    shape-inside-merge-field

Additionally, you can use \x and \y switches to keep the aspect ratio of the picture that’s being merged. For example, please check the Merge Pictures - Picture field with template example.

To add a switch into a field, press ALT + F9 and write inside the field’s code:
field-switch-for-keep-aspect-ratio

Regards,
Mario

1 Like

Thanks, it worked !!