Image Processing in Documents

If your database contains data with file attachments or URL columns containing images, you can embed these images into a document when generating it.

Here, you can learn how to specify the size of an image embedded in a generated document.

When you embed an image stored in a column of the File Attachment type or URL type, please ensure that the Image or Signature type is activated in the File Attachment column settings, or the Image option is chosen in the Display as field in the URL column settings.

The image size can be specified directly in the generated document template if the "Toggle Field Codes" option is enabled in MS Word settings. If only a column name (for example, "Image") is displayed in a generated document, you should activate the "Toggle Field Codes" option in MS Word, and this column will be displayed like { MERGEFIELD Image }. To activate the "Toggle Field Codes" option for all columns, press Alt+F9. To enable it for a specific column, place the cursor on the column of interest, for example, "Image," activate the Right-Click Menu, and select the "Toggle Field Codes" option.

Images from URL columns and formulas are embedded at full scale by default. To override this behavior, you can add the #ps suffix after the field name in the MERGEFIELD code to specify the image’s bounding box size. The image will retain its aspect ratio and won’t exceed the box dimensions - no upscaling is performed.

The suffix accepts either one number to specify a square bounding box or two numbers separated by "x" to specify a rectangular bounding box and the unit of measurement - either in, cm, mm, pt, or px.

Suppose there is a column called Image in your database. By default, { MERGEFIELD Image } is generated into the document template. To fit its content into a 200x200px box, modify the field code to { MERGEFIELD Image#ps200px }. To fit it into a 6.5x10cm box, use { MERGEFIELD Image#ps6.5x10cm }.

To illustrate this, let’s create a simple document with a "Logo" column pointing to the TeamDesk logo, which is a 450x450 image (approximately 12x12cm).
Let`s add the following suffixes:


Logo Resize

And here are the results:

Logo Resize Result

As you can see, the first logo was downscaled into a 100x100px box. The second logo, despite the specified rectangular box of 5x10cm, was downscaled to 5x5cm to maintain its aspect ratio. Since the dimensions of the last box exceed the logo’s size, the third logo was not upscaled, rather retaining its original 12x12cm size.