Image processing in documents
In case your database data includes file attachment or URL columns with images, you can embed these images into a document when generating it.
Here you can read how to specify a size of an image imbedded into a generated document.
When you embed an image stored in a column of the File Attachment type or URL type, please be sure that Image
orSignature
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 Toggle Field Codes option for all columns, click Alt+F9. To enable it in a certain column, put cursor on a column of interest, for example "Image", activate Right-Click Menu and select the Toggle Field Codes option.
Images from URL columns and formulas are embedded in a full scale by default. To override this behavior you can add #ps suffix after the field name in MERGEFIELD code to specify image’s bounding box size. The image will retain its aspect ratio and won’t exceed box dimensions - no upscaling is performed.
The suffix accepts either one number to specify square bounding box or two numbers separated by "x" to specify 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 200x200px box, modify field code to { MERGEFIELD Image#ps200px }
. To fit it into 6.5x10cm box, use { MERGEFIELD Image#ps6.5x10cm }
.
To illustrate it, let’s create simple document with "Logo" column pointing to TeamDesk logo which is 450x450 image (approximately 12x12cm)
And here are the results:
As you can see, first logo was downscaled into 100x100px box. Second logo, despite the specified rectangular box 5x10cm, was downscaled to 5x5cm to maintain its aspect ratio. Since last box’s dimensions exceed logo size, third logo was not upscaled, rather retaining its original 12x12cm size.