When creating graphic items in an EPP data dictionary, the default Type is “Constant”, which means the graphic will also be the same on the label templates they are implemented on. Sometimes, customers may want to only print a graphic occasionally, like a hazard warning or fragile icon. Additionally, there can be a need to dynamically change what graphic file is used on a label template, without having to create multiple copies of a label template to represent the different graphic options/scenarios that might be needed. These use cases can leverage the EPP “Variable” Type graphic items, allowing the print request variables to declare if a graphic item is used OR which graphic item is used when printing the label.
Product Release/Version
Applies to EPP 10.0.0.0 to 10.2.0.0
Implementation Guidelines
We’re going to walk through the steps of creating a variable type graphic item, adding the graphic to a label template design and running through some sample print scenarios. You can use these steps as a reference to your own graphic and label implementations OR upload the attached sample items to your EPP installation.
Creating Data Dictionary Graphic Items
Open or create a Data Dictionary and then create a variable type graphic item in the data dictionary. Upload/select an image file to be the default value, which will be used in the EPP Label Designer label template preview canvas. Set the graphic item ‘Type’ to “Variable”, in order to make the graphic printing dynamic.
Each EPP installation will come with a lot of sample graphic files. Of these, there is several sample ISO hazard/safety graphics, in half inch, three eights inch, and quarter inch sizes (203 dpi). These are the half inch sized samples below:
| ISO.Battery | ISO.Corrosive | ISO.Flammable | ISO.General | ISO.laser | ISO.toxic |
|---|---|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
NOTE 1. Many label printers won’t support most JPG, JPEG, or BMP images OR high color depths; even if the “color” image only contains black and white pixels. Most printers will work well with PCX graphic files, using 2 color depth (1 BPP) configuration.
See this post which outlines how to convert image/graphic files to 2 color PCX files.
NOTE 2. EPP will use graphic files uploaded to the PostgreSQL database, through the Data Dictionary editor, for Label Designer previews and label printing. EPP 10.1.0.3 and later builds can support label printing with graphics stored in the EPP installations, graphics subfolder. e.g. ‘..\DSIPrint\graphics\cake.image.pcx’. However, the Label Designer canvas previews are still limited to only rendering graphics that were uploaded to the EPP database AND EPP label printing will prioritize the graphic loaded in the database, even if a file by the same name is stored in the installations graphics folder.
Creating a Label Template
On the EPP ‘Develop > Label Designer’ page, create a label template and add the recently created variable graphic item to your label canvas. The below example is something I threw together pretty quickly.
I’ve attached a copy of the above data dictionary and below label template to this doc, in case you would like to load them.
VarGraphics.ldd (427 Bytes) vg_ItemLabel.lbl (1.0 KB) ApertureLogo_03.pcx (3.0 KB)
Test Printing Variable Graphics Scenarios
However you designed your label template, you next need to test printing the label with your various graphic options you aim to support. When sending the print request to EPP, you will need to define the graphic item variable [e.g. “ItemGraphic”] and assign it a value for which graphic file you want EPP to place on the label template.
The file name does require the file extension. If the defined graphic file is not in the EPP PostgreSQL database, then EPP 10.1.0.3 (and later) will check the EPP installations graphics folder for the file to use in the label data.
Batch printing, sample print request XML:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE labels SYSTEM "dsi-label.dtd">
<labels _FORMAT="vg_ItemLabel.lbl" _PRINTERNAME="defaultSite#FauxPrinter" _QUANTITY="1">
<label _FORMAT="vg_ItemLabel.lbl" _PRINTERNAME="defaultSite#FauxPrinter" _QUANTITY="1">
<variable name="ItemNumber">18609660445328</variable>
<variable name="ItemDescription">Card Deck, Atomic Wrangler Casino</variable>
<variable name="_Scenario">Not defining the graphic file.</variable>
<variable name="ItemGraphic"/>
</label>
<label _FORMAT="vg_ItemLabel.lbl" _PRINTERNAME="defaultSite#FauxPrinter" _QUANTITY="1">
<variable name="ItemNumber">45140816077489</variable>
<variable name="ItemDescription">RC Toy Robot</variable>
<variable name="_Scenario">Printing a label with the ISO Battery image.</variable>
<variable name="ItemGraphic">ISO.Battery.HalfInch.203dpi.pcx</variable>
</label>
<label _FORMAT="vg_ItemLabel.lbl" _PRINTERNAME="defaultSite#FauxPrinter" _QUANTITY="1">
<variable name="ItemNumber">13225427562555</variable>
<variable name="ItemDescription">Goo</variable>
<variable name="_Scenario">Printing a label with the ISO Corrosive image.</variable>
<variable name="ItemGraphic">ISO.Corrosive.HalfInch.203dpi.pcx</variable>
</label>
<label _FORMAT="vg_ItemLabel.lbl" _PRINTERNAME="defaultSite#FauxPrinter" _QUANTITY="1">
<variable name="ItemNumber">67791839133558</variable>
<variable name="ItemDescription">Companion Cube</variable>
<variable name="_Scenario">Printing a label with the ISO Flammable image.</variable>
<variable name="ItemGraphic">ISO.Flammable.HalfInch.203dpi.pcx</variable>
</label>
<label _FORMAT="vg_ItemLabel.lbl" _PRINTERNAME="defaultSite#FauxPrinter" _QUANTITY="1">
<variable name="ItemNumber">50508246740164</variable>
<variable name="ItemDescription">42 Bottle Caps</variable>
<variable name="_Scenario">Printing a label with the ISO General image.</variable>
<variable name="ItemGraphic">ISO.General.HalfInch.203dpi.pcx</variable>
</label>
<label _FORMAT="vg_ItemLabel.lbl" _PRINTERNAME="defaultSite#FauxPrinter" _QUANTITY="1">
<variable name="ItemNumber">60579301075553</variable>
<variable name="ItemDescription">Portable CD Player</variable>
<variable name="_Scenario">Printing a label with the ISO Laser image.</variable>
<variable name="ItemGraphic">ISO.Laser.HalfInch.203dpi.pcx</variable>
</label>
<label _FORMAT="vg_ItemLabel.lbl" _PRINTERNAME="defaultSite#FauxPrinter" _QUANTITY="1">
<variable name="ItemNumber">86058056553652</variable>
<variable name="ItemDescription">Brahmin Steak</variable>
<variable name="_Scenario">Printing a label with the ISO Toxic image.</variable>
<variable name="ItemGraphic">ISO.Toxic.HalfInch.203dpi.pcx</variable>
</label>
</labels>
Below is a PDF example of the generated batch printed labels, ZPL data produced by EPP and emulated in Labelary.
Invalid Graphic File Naming
If EPP cannot find the defined file in either location, then the print request will be aborted and an error message will state that the graphic file does not exist.
Bad request example:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE labels SYSTEM "dsi-label.dtd">
<labels _FORMAT="vg_ItemLabel.lbl" _PRINTERNAME="defaultSite#FauxPrinter" _QUANTITY="1">
<label _FORMAT="vg_ItemLabel.lbl" _PRINTERNAME="defaultSite#FauxPrinter" _QUANTITY="1">
<variable name="ItemNumber">18609660445328</variable>
<variable name="ItemDescription">Card Deck, Atomic Wrangler Casino</variable>
<variable name="_Scenario">Wrong file name.</variable>
<variable name="ItemGraphic">This.file.is.not.here.pcx</variable>
</label>
</labels>
API error response: “Exception occurred while processing the new print job. Print Job 32 processing error. Check logs for: Error in GraphicItemCommandBuilder: Graphic does not exist:This.file.is.not.here.pcx”
Printer and Job Monitor, print job details.









