In this article, you will learn
- how to create a variable fill color and variable stroke color for a shape without uploading a CSV file,
- how to create a variable fill color and variable stroke color based on a CSV file, and
- how to apply a static fill or stroke color to a shape.
1. General
In practice, creating variable fill colors and stroke colors for shapes is not a common task in everyday variable data production. However, if the design is intended to vary significantly from one print to the next, variably colored shapes and strokes can serve as a flexible design object.
Variable color objects can be useful in the following use cases:
- Background Overlays – background shapes that dynamically adapt to the object in the foreground. In some cases, this makes it possible to add a colored background without having to change the overall design.
- Filling Masked Areas – transparent areas within a design can be dynamically filled with color.
- Price Tags – dynamically adjusting the background and stroke colors of price labels to highlight special offers or promotions.
- Coloring Image Areas – in combination with fill methods, specific areas within an image can be colored dynamically.
2. Create Variably Colored Objects
You want to color the background of a sticker dynamically by using color values stored in a CSV file.
To achieve this, proceed as follows:
- Open the desired Article or Print Item in the VDP Editor.
- Activate the icon TG [3] to immediately visualize the transparent areas of the Print Item. Transparent areas are a prerequisite for creating a variably colored background.
- Then select the Rectangle Tool [1].
- Draw a rectangle from the top left to the bottom right edge, covering the Print Item area including the Bleed. The X and Y position as well as the width and height of the rectangle, can be adjusted at any time in the Transform settings [4]. The red color for the rectangle [2] visually indicates to the user that the rectangle object has been placed on the VDP on highest layer.
Figure 1: The Print Item while drawing a rectangle using the VDP Rectangle Tool
- After releasing the mouse button, a rectangle with a black stroke [6] – the default color when creating a VDP object – is created. By default, VDP objects are placed on the VDP on highest layer. In addition, a warning message [5] will appear, simply indicating that a variable object extends beyond the ImageBox. In this case, this is the intended behavior.
- Navigate to the tab Layers [7].
- In this tab, drag the variable object [8] from the VDP on highest layer to the layer VDP on lowest layer, and then release the mouse button.
Figure 2: The created rectangle with the tab Layers open, showing the VDP object still placed on the highest layer
- The VDP object now appears in green [11], indicating that it is placed on the VDP on lowest layer.
- Switch back to the tab Transform & General Settings [9] to precisely enter the X and Y coordinates, as well as the Width and Height [10] of the rectangle.
- Then upload the desired CSV file [12] containing the color values to be used.
Figure 3: The tab Transform & General Settings, where the VDP object can be precisely positioned and the CSV file uploaded
- Since only the Fill Color and Stroke Color of VDP objects can be modified, the tab Content [13] is not available for editing.
- To define a variable color value, you must switch to the tab Format [14].
- Open the sections Fill Color Settings [15] and Stroke Color Settings [20].
- In the section Fill Color Settings, select the option Data Source [16].
- In the drop-down menu Data Source, choose the option Column Title [17]. In the drop-down menu Column Header [18], select the column from your CSV file that contains the color values. In the drop-down menu Color Space [19], select the color space in which the color values in the CSV file are defined.
- In the section Stroke Color Settings, select the option Color Picker [21] and set the stroke to No Color [22].
Figure 4: The tab Format, where the VDP object is filled with a variable Fill Color
- The task is now complete. To verify that the color values are actually changing, select a different data record [23].
- Finish the operation process by selecting the option Save from the menu.
Test Data
If you don't want to recreate everything, you can download the print file and the corresponding VDP settings here. Then upload the print file to the Workflow and import the VDP settings.
3. Specific Features
Some new specific features are available in conjunction with variable Fill and Stroke Colors. The following description goes into these specific features.
3.1. Create Static Fill or Stroke Colors
If you need to color a geometric object in a VDP job for any reason, you can do this at any time – without having to edit the original Print Item. Proceed as follows:
- Create the desired object using the VDP Object Creation Tools [24]. In the example, the white placeholder area originally intended for placing a barcode will be colored gray.
- Open the tab Format [25] and expand the section Fill Color Settings [26] to define the Fill Color.
- Select the option Color Picker [27].
- You can either enter a CMYK color value [28], select a color via the Color Picker by clicking the color circle [30] or use a system-wide defined Spot Color [29]. For more detailed information on choosing colors, refer to the Article Create and Edit variable Objects.
Figure 5: The tab Format with a defined color value for the Fill Color
3.2. Create Variable Fill or Stroke Colors Without a CSV file
If you want to generate variable Fill Colors for objects or backgrounds, you can do this without using a CSV file. In the following example, the color values will change from record to record as follows:
- Cyan – the color value always increases by 20% each time and resets to 0% after reaching 100%.
- Magenta – the color value always increases by 10% and resets to 0% after reaching 100%.
- Yellow – the color value always increases by 5% and resets to 0% after reaching 100%.
- Black – the color value always increases by 1% and resets to 0% after reaching 40%.
To define these color values, proceed as follows:
- Create the desired object using the VDP Object Creation Tools.
- Open the tab Format [31] and expand the section Data Source [32] to define the Fill Color.
- Select the option String [33].
- In the input field String [34], you will see the default text «Sample Content». Delete this text from the input field.
- Click the button Insert Placeholder [35]. In the dialog that appears, select Serial Number. This inserts the string
${serial_number; start=1; width=1; batch_count=0; repeat_count=0; increment=1}
. Add%
, to the end of this string to define the Cyan value. - Modify the values [37] below as follows to achieve the desired behavior for Cyan:
-
Start –
start=0
-
Increment –
increment=20
-
Repeat after –
repeat_count=100
-
Start –
- Repeat the same process for Magenta, with the following values:
-
Start –
start=0
-
Increment –
increment=10
-
Repeat after –
repeat_count=100
-
Start –
- Repeat the same process for Yellow, with the following values:
-
Start –
start=0
-
Increment –
increment=5
-
Repeat after –
repeat_count=100
-
Start –
- Repeat the same process for Black, but note that only a single
%
should be added at the end of the string:-
Start –
start=0
-
Increment –
increment=5
-
Repeat after –
repeat_count=100
-
Start –
- Once completed, your input field String [31] should contain the following definition:
${serial_number; start=0; width=1; batch_count=0; repeat_count=100; increment=20}%,${serial_number; start=0; width=1; batch_count=0; repeat_count=100; increment=10}%,${serial_number; start=0; width=1; batch_count=0; repeat_count=100; increment=5}%,${serial_number; start=0; width=1; batch_count=0; repeat_count=40; increment=1}
- Now select the correct Color Space [38] from the drop-down menu – in this case, it is CMYK.
- Finally, click the button Update [36] to apply the color definition and complete the task.
Figure 6: The tab Format with a variable color definition for the Fill Color based on a Serial Number
3.3. Create a Variable Stroke Color for a Dashed Stroke
If you want to create a dashed stroke with a changing color in a VDP job, this can be accomplished with a few additional steps. Follow the instructions below:
- Open the desired Print Item in the VDP Editor.
- Prepare the VDP Editor by uploading a CSV file that contains two columns with color codes.
- Create the desired Stroke using the VDP Object Creation Tools [39]. In this example, the VDP Bezier Curve Tool was used to draw a Bezier path.
- Select the tab Format [40] and open the section Path Settings [41] to define the Stroke Width. Enter the desired Stroke Width [42] and ensure that it is a continuous line. A solid line is created by setting the second value in the field Dash / Gap [43] to «0».
- Next, open the section Stroke Color Settings to define the Stroke Color. First, activate the option Data Source [44]. Then select the entry Column Title in the option Data Source [45]. Under Column Header [46], choose the column from the CSV file containing the color values. Under the option Color Space [47], select the color space in which your color values are defined – in this example, CMYK. This completes the creation of a solid stroke whose color changes from record to record.
Figure 7: The VDP Editor with an irregular shape and the values for the Stroke in the tab Format
- Duplicate the path
- by copying the VDP object with
Ctrl
+C
to copy and thenCTrl
+Shift
+V
to paste it in the exact same position or - by using
alt
(Windows) oroption
(Mac) to duplicate the object by dragging. To ensure the duplicated path is precisely overlaid on the original, use the Arrange functions or manually set the X and Y coordinates for the object in the tab Transform & General Settings.
- by copying the VDP object with
- Create a dashed line by specifying the value for the gap [49] in the option Dash / Gap. Under the option Column Header [50], select the second color value column from the CSV file for this path. To intensify or reduce the visual effect, choose an appropriate option from the drop-down menu Blend Mode [48].
- You have now completed the task. Switch between individual records to verify that the visual effect haves as expected.
Figure 8: The VDP Editor with an irregular shape, showing the values used in the Path Settings and Stroke Color Settings within the tab Format
Overprinting Objects
Please note that the options Overprint and Knockout are not available in the VDP Editor. By default, when VDP objects overlap, they knock out the colors of the underlying objects – no action is needed. However, if you want a VDP object to overprint, you can use the option Multiply under the setting Blend Mode [48] in the tab Format of the VDP Editor. This achieves the same visual effect as traditional overprinting.
Article update: Workflow version 1.19.2 – 05/2025