In this chapter you will learn
- how to create variable images without uploading a CSV file,
- how to use variable images based on a CSV file,
- what requirements must be met to create variable images, and
- which parameters exist for the placing of images.
1. General
An image can have different content - pixel information, vectors, text, or combinations of all. Thus, when speaking of a variable image herafter, generally a graphical image is understood. Variable images are, in practice, mostly used for the following applications:
- ID cards - for personalization of the passport photo.
- Access authorizations - for placing encrypted barcodes / QR codes generated in an external application.
- Number plates - for placing a coat of arms in combination with an unique number.
- Visitor patches - for placing passport photos as well as specifically coded QR codes created in an external application.
- Packaging - for personalization of cake or praline packaging.
- Labels - for personalization of wine or beer labels.
The field of application for variable images is very wide. In many cases, variable images are used only for design purposes or to create unique items. The use of variable images opens up a variety of possibilites for designing.
1.1. File types
At this point it should be mentioned as a reminder that in the VDP Editor not all file types can be used for variable images. Thereby, it is immaterial which color space is used for the images. The following file types are supported under the listed requirements:
-
jpg
– JPEG files of every degree of compression -
png
– PNG files; as well alpha masks are evaluated -
tif
/tiff
– TIFF files; as well alpha masks are evaluated; Photoshop setting layers should be avoided as unusal construct can cause unexpected results in the output - used images in the SVG file must be embedded
base64
coded; theviewBox
must be set -
pdf
– PDF files
1.2. Preparations
Before using variable images in the VDP Editor, the following preparations must be made on the Workflow server, as well as in the Workflow:
- File type - save the images in a supported file format.
- Location - create a directory on the server where the workflow is installed or on a directory where the workflow has access.
- Copying of variable images - copy the variable images to the previously created directory.
- Set up a share - make the created directory available for the workflow. For a more detailed description, see the article Manage Shares and Folders.
2. Create variable images
After completing the preparations, you can start creating a variable image in the VDP editor. The following example describes the creation of a variable image which should be filled proportionally, centered horizontally and vertically in the placeholder. Proceed as follows:
- Select the desired Article or Print Item in the Workflow.
- Start the VDP Editor, the Print Item is displayed in the VDP Editor and the Transform & General Settings [2] tab is already activated for subsequent steps.
- Click on Upload/Replace CSV file [4] to upload a CSV file and complete the process. After that the file name [3] of the CSV file should be displayed under Global Settings - File Name.
- Click on the Select Folder icon [5] to select the path to the directory where the variable images are stored.
- Start creating variable images. To do this, select the VDP Image Tool [1] in the toolbar and use it to drag the corresponding placeholder frame [6] on the Print Item.
Figure 1: The VDP Editor with uploaded CSV file and its established path to the Image Directory
- After releasing the mouse button, a left-aligned dummy image is displayed in the placeholder frame [8].
- Furthermore, a warning message [7] is displayed, informing users that no image with the file name Sample Content can be found in the directory. This warning message can be ignored, since the desired data source is not selected until the next step.
Figure 2: The VDP Editor with a placeholder image of a variable image
- dIn order to assign the correct file name of the image to the placeholder frame, switch to the Content tab [9].
- Select the entry Column Title [10] or Column Index in Data Source and then select the designated Column Header [11] - in our example IMAGE - in the option Column Title/Column Index.
- If the entry of the first record in the IMAGE column of the CSV file contains the file name of the selected image directory, the dummy preview will be replaced by the corresponding image preview [12] in the placeholder frame. Size, orientation and position of the image coincide with the previously displayed dummy preview.
Figure 3: The VDP Editor with preview image of the first record from the CSV file
Wrong file type
If the image content belongs to an unsupported file type a warning message will be displayed.
- The last step is to define the position and scaling in the placeholder frame. To do this, switch to the Format tab [13].
- For the described example, select the following parameters in the Image Settings [14] settings area:
- the centered icon for the options Horizontal Align Center [15] and Vertical Align Center [16], and
- Fill Image - keep proportions in the Image adjustment options.
Figure 4: The VDP Editor with fitted variable image
- Check a few subsequent data sets to make sure that the selected image adjustment displays the correct image detail for all images.
- After successful checking, save the VDP specification with the Save button.
3. Particularities
In connection with variable images a few particularities are available.
In the following description all options that can be used for variable images are described.
3.1. Image fit
Probably the most central setting options are available in the Image Settings area in the Format tab. The following options are available for fitting variable images:
Horizontal Alignment
In the Horizontal Align [18] option, the image can be aligned to the left, center or right in the frame.
Figure 5: Illustration of the different options in the Horizontal Align option with Fit Image - keep proportions in the Image adjustment options
Vertical Alignment
In the Vertical Align [19] option, the image can be aligned to the left, center or right in the frame.
Figure 6: Illustration of the different options in the Vertical Alignment option with Fit Image - keep proportions in the Image adjustment options
Image adjustment options
In the Image adjustment options you can basically choose whether the image should be proportionally fitted, proportionally filled or stretched in the image frame. The following options are available:
Fit image - keep proportions [20]
The image is proportionally fitted into the frame so that the whole image remains visible. Depending on the horizontal or vertical alignment of the image in the placeholder frame, an unprinted (transparent) area is created in the image frame. This is shown, for example, in Figure 5 and Figure 6.
Fill image - keep proportions [21]
The image is proportionally adjusted to the height or width of the placeholder frame so that the image frame is completely filled with the image. Depending on the horizontal or vertical alignment of the image in the placeholder frame, the corresponding section of the image is displayed.
Figure 7: Illustration of the different options in the Vertical Align option with Fit Image - keep proportions in the Image adjustment options
Stretch [22]
The image is stretched into the frame. The selections in the Horizontal Align, Vertical Align and Image adjustment options are disabled when the Stretch option is enabled.
Figure 8: The image was fitted frame filling stretched
3.2. Add static image
To insert a static image as a graphic object in the background when creating a variable order, use the placeholder frame for a variable image. Proceed as follows to insert a static image.
- Save the desired image in the Image Directory you selected in the Transform & General Settings tab.
- In the Layers tab, select VDP on the lowest level and use the VDP Image Tool to create the desired placeholder in the desired size and position. In the example below, the placeholder frame was created beyond the ImageBox in order to output the image to the printer in full bleed manner. For this reason, the warning messages also indicate that a variable element overlaps the size of the final format.
- Switch to the Content tab [23].
- Select the entry String [24] in the Data Source option.
- Then type in the file name of the image to be placed, including the file extension, in the String [25] input field and press Update.
- Afterwards you have to adjust the image in the Format tab.
Figure 9: The Print Item was provided with a static background image
3.3. View variable images via a dynamic string
In order to use a series of variable images in a VDP job, in practice a CSV file is created manually for this purpose. This CSV file simply contains a column of image names, usually numbered sequentially e.g. - Image_001.jpg; Image_002.jpg; Image_003.jpg or Image_001.jpeg, ... etc.
Displaying image data with a sequential number can also be done without creating a CSV file in the VDP Editor. Proceed as follows:
- Save the desired images in the image directory that you selected in the Transform & General Settings tab.
- Use the VDP Image Tool to create the desired placeholder in the desired size and position (don't forget to choose VDP on lowest layer in the Layer tab).
- Switch to the Content tab [26].
- In the Data Source option select the entry String [27].
- Type e.g. the characters
Bild_
(for this example the images were saved with this prefix) in the String input field [28] and press Insert placeholder [30]. - In the appeared dialog, select the Serial Number option. This will insert the string
${serial_number; start=1; width=1; batch_count=0; repeat_count=0; increment=1}
. - Move the cursor in the text to the word
width
click - below the input fields for defining a serial number are displayed. Enter the value 3 in the input field for Width [31], which creates two leading zeros for one-digit numbers, one leading zero for two-digit numbers and no leading zero for three-digit numbers. - Enter the suffix of your images files e.g.
.jpeg
at the end of the string. This results in the following string:Bild_${serial_number; start=1; width=3; batch_count=0; repeat_count=0; increment=1}.jpeg
. - Press Update [29] - thereby the whole string is passed on to the VDP editor and executed.
- Apply the appropriate image adjustment in the Format tab.
Figure 10: The Print Item with a dynamic background image based on a String with embedded Serial Number
Article update: Workflow version 1.13.2 – 08/2022