This action specifies the name of the printer to be used for printing the active label.
Note
This action overrides the printer selected in the label properties.
This action is useful when printing an identical label on multiple printers. Always nest this action under the Open Label action to provide the label with the reference for the preferred printer.
This action reads the default settings (such as speed and darkness) from the selected printer driver and applies them to the label. If you don't use the Set Printer action, the label gets printed using the printer defined in the label template.
Warning
Pay attention when switching the printers, e.g. from Zebra to SATO, or even from one printer model to another model of the same brand. Printer settings might not be compatible and the label printouts might not appear identical. Also, label design optimizations for original printer, such as internal counters, and internal fonts, might not be available on the newly selected printer.
Printer group specifies the printer name to be used for the current print job.
-
Printer name: select it from the list of locally installed printer drivers, or manually enter a printer name. Select Data source to dynamically select the printer using a variable. If enabled, select or create a variable that contains the printer name which is used if the action is run.
This action specifies the name of the print job file as it appears in the Windows Spooler. A default print job name is the name of the used label file. This action overrides it.
Note
Always nest the action under the Open Label action, so it applies to the adequate label file.
Print Job group defines the print job name.
-
Name: sets the print job name. It can be hard-coded, and the same name is used for each print action. Variable enables a variable file name. Select or create a variable that contains the path and/or file name if the event happens or a trigger fires.
Note
In Automation Builder module, the variable value is usually assigned by a filter.
This action diverts the print job to a file. Instead of sending the created print file to a printer port as defined in the printer driver, the printout is redirected to a file. You can append data to an existing file, or overwrite it.
This action enables you to capture printer commands in a separate file.
The action instructs Automation Builder module to redirect printing – as a result, the labels are not going to be printed. Make sure the action is followed by the Print Label action.
Note
NiceLabel Automation runs as service under defined Windows user account. Make sure this user account has privileges accessing the specified folder with read/write permissions. For more information, see section Access to Network Shared Resources in the NiceLabel Automation user guide.
Note
Redirect Printing to File action is useful for printing several different labels (.NLBL files) to a network printer while retaining the correct order of labels. If multiple .NLBL files are printed from the same trigger, Automation Builder sends each label to the printer in a separate print job, even if the target printer is the same for both labels. If a network printer is used, job of another user can be inserted between two jobs the trigger must send together. Using this action, you can append print data into the same file and send its contents to the printer using the Send Data to Printer action.
File group of settings defines how the file selection for redirecting is done.
-
File name:specifies the file name. It can either be hard-coded or dynamically defined using an existing or a newly created variable.
Use UNC syntax for network resources. For more information, see section Access to Network Shared Resources in NiceLabel Automation user guide.
Note
When using this action, make sure your user account has sufficient privileges for accessing the specified folder with read/write permissions.
File write mode group of settings selects how the file is treated in case of repeated redirects.
-
Overwrite the file: if the specified file already exists on the disk, it is going to be overwritten.
-
Append data to the file: the job file is added to the existing data in the provided file.
Persistence group controls the continuity of the redirect action. It defines the number of Print Label actions that are affected by the Redirect Printing to File action.
-
Apply to next print action: specifies for the print redirect to be applicable to the next Print Label action only (single event).
-
Apply to all subsequent print actions: specifies for the print redirect to be applicable to all Print Label action defined after the current Redirect Printing to File action.
Note
The action only redirects printing. Make sure it is followed by the Print Label action.
This action allows you to fine tune the parameters that relate to the printer driver. These include parameters such as speed and darkness for label printers, or paper tray for laser printers.
Printer settings are applied to the current printout only and are not remembered during the upcoming event.
Warning
Your parameters from Set Print Parameter action don't apply when you preview or reprint labels from your Control Center.
You can avoid this by saving your print parameters (printer properties) in your label template or your printer driver. Printer properties may differ from driver to driver and also from printer to printer.
Note
If you use Set Printer action to change the printer name, make sure the Set Print Parameter action is used right after. Before you can apply the DEVMODE structure to the printer driver, first load the default driver settings. This is done by the Set Printer action. The DEVMODE is only compatible with the DEVMODE of the same printer driver.
Print Parameters group allows action fine tuning before printing.
-
Paper bin: name of the paper bin that contains the label media. This option is usually used with laser and ink jet printers with multiple paper bins. The provided name of the paper bin must match the name of the bin in the printer driver. Check the printer driver properties for more details.
-
Print speed: defines printing speed. This setting overrides the setting defined with label. The provided value must be in the range of accepted values.
Example 41. Example
The first printer model accepts a range of values from 0 to 30, while the second printer model accepts values from -15 to 15. For more information, see printer driver properties
-
Darkness: defines the darkness of the printed objects on the paper and overrides setting from the label. The provided value must be in range of accepted values.
-
Print offset X: applies horizontal offset. The label printout will be repositioned by the specified number of dots in the horizontal direction. Negative offset can be defined.
-
Print offset Y: applies vertical offset. The label printout will be repositioned by the specified number of dots in the vertical direction. Negative offset can be defined.
Tip
All print parameters can either be hard-coded or dynamically defined using an existing or a newly created variable.
Advanced group customizes the printer settings that are sent along with the print job.
Printer settings, such as printing speed, darkness, media type, offsets and similar, can be defined as follows:
-
Defined in a label
-
Recalled from a printer driver
-
Recalled from a printer at print time
The supported methods depend on the printer driver and its capabilities. Printing mode (recall settings from label or driver or printer) is configurable in the label design. You might need to apply these printer settings at print time – they can vary with each printout.
Example 42. Example
A single label should be printed using a variety of printers, but each printer requires slightly different parameters. The printers from various manufacturers don't use the same values to set the printing speed or temperature. Additionally, some printers require vertical or horizontal offset to print the label to the correct position. During the testing phase, you can determine the optimal settings for every printer you intend to use and apply them to a single label template just before printing. This action will apply the corresponding settings to each defined printer.
This action expects to receive the printer settings in a DEVMODE structure. This is a Windows standard data structure with information about initialization and environment of a printer.
Printer settings option applies custom printer settings. The following inputs are available:
-
Fixed-data Base64-encoded DEVMODE. In this case, provide the printer's DEVMODE encoded in Base64-encoded string directly into the edit field. If executed, the action converts the Base64-encoded data back into binary form.
-
Variable-data Base64-encoded DEVMODE. In this case, the selected data source must contain the Base64-encoded DEVMODE. Enable Data source and select the appropriate variable from the list. If executed, the action converts the Base64-encoded data back into the binary form.
-
Variable-data binary DEVMODE (available in Automation Builder). In this case, the selected variable must contain the DEVMODE in its native binary form. Enable Data source and select the appropriate variable from the list. If executed, the action uses the DEVMODE as-is, without any conversion.
Note
If the variable does not provide a binary DEVMODE, make sure that the selected variable is defined as a binary variable in the configuration.
Note
Make sure the Set Printer action is defined in front of this action.
Label settings overrides label properties defined in Label Properties in Designer. Use this option when you print your labels to a printer or media with different properties as defined in Label Properties in Designer. With this option you can:
-
Change your label dimensions (width and height).
-
Add or change label margins.
-
Disable cutter.
-
Disable batch printing.
-
Apply different stocks by changing Labels Across parameter (horizontal and vertical count, gaps, processing order).
-
Redefine Portrait or Landscape orientation.
-
Rotate labels by 180° degrees.
Automation applies Label settings at print time. Label settings parameters are not saved in your label templates. You can provide Label settings as an XML payload.
Sample Label settings XML
The sample below presents a structural view of the label settings and their attributes.
Note
Dimension units in XML correspond to your label design units (cm, in, mm, dot). You can change units in Designer if you go to Label Properties > Label Dimensions > Unit of measure.
<LabelSettings> <Width>100</Width> <Height>30</Height> <Margin> <Left>2</Left> <Right>3</Right> <Top>4</Top> <Bottom>5</Bottom> </Margin> <LabelsAcross> <Horizontal> <Count>2</Count> <Gap>4</Gap> </Horizontal> <Vertical> <Count>3</Count> <Gap>5</Gap> </Vertical> <ProcessingOrder>HorizontalTopRight</ProcessingOrder> </LabelsAcross> <Orientation>Landscape</Orientation> <Rotated>true</Rotated> <DisableCutter/> <DisableBatchPrinting/> <PaperType>Roll or Sheet</PaperType> <PaperName>A5</PaperName> </LabelSettings>
Label settings XML specification
This section contains a description of the XML file structure to define Label settings parameters and values.
<?xml version="1.0" encoding="utf-8"?> <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:simpleType name="nonNegativeFloat"> <xs:restriction base="xs:float"> <xs:minInclusive value="0"/> </xs:restriction> </xs:simpleType> <xs:element name="LabelSettings"> <xs:complexType> <xs:all> <xs:element name="DisableCutter" minOccurs="0" maxOccurs="1"> <xs:complexType> <xs:sequence/> </xs:complexType> </xs:element> <xs:element name="DisableBatchPrinting" minOccurs="0" maxOccurs="1"> <xs:complexType> <xs:sequence/> </xs:complexType> </xs:element> <xs:element name="Width" type="nonNegativeFloat" minOccurs="0" maxOccurs="1"/> <xs:element name="Height" type="nonNegativeFloat" minOccurs="0" maxOccurs="1"/> <xs:element name="Margin" minOccurs="0" maxOccurs="1"> <xs:complexType> <xs:all> <xs:element name="Left" type="nonNegativeFloat" minOccurs="0" maxOccurs="1"/> <xs:element name="Right" type="nonNegativeFloat" minOccurs="0" maxOccurs="1"/> <xs:element name="Top" type="nonNegativeFloat" minOccurs="0" maxOccurs="1"/> <xs:element name="Bottom" type="nonNegativeFloat" minOccurs="0" maxOccurs="1"/> </xs:all> </xs:complexType> </xs:element> <xs:element name="LabelsAcross" minOccurs="0" maxOccurs="1"> <xs:complexType> <xs:all> <xs:element name="Horizontal" minOccurs="0" maxOccurs="1"> <xs:complexType> <xs:all> <xs:element name="Count" type="xs:nonNegativeInteger" minOccurs="0" maxOccurs="1" /> <xs:element name="Gap" type="nonNegativeFloat" minOccurs="0" maxOccurs="1"/> </xs:all> </xs:complexType> </xs:element> <xs:element name="Vertical" minOccurs="0" maxOccurs="1"> <xs:complexType> <xs:all> <xs:element name="Count" type="xs:nonNegativeInteger" minOccurs="0" maxOccurs="1" /> <xs:element name="Gap" type="nonNegativeFloat" minOccurs="0" maxOccurs="1"/> </xs:all> </xs:complexType> </xs:element> <xs:element name="ProcessingOrder" minOccurs="0" maxOccurs="1"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="HorizontalTopLeft"/> <xs:enumeration value="HorizontalTopRight"/> <xs:enumeration value="HorizontalBottomLeft"/> <xs:enumeration value="HorizontalBottomRight"/> <xs:enumeration value="VerticalTopLeft"/> <xs:enumeration value="VerticalTopRight"/> <xs:enumeration value="VerticalBottomLeft"/> <xs:enumeration value="VerticalBottomRight"/> </xs:restriction> </xs:simpleType> </xs:element> </xs:all> </xs:complexType> </xs:element> <xs:element name="Orientation" minOccurs="0" maxOccurs="1"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="Portrait"/> <xs:enumeration value="Landscape"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="Rotated" type="xs:boolean" minOccurs="0" maxOccurs="1"/> </xs:all> </xs:complexType> </xs:element> </xs:schema>
This action diverts the print job to a PDF document. The created PDF document retains the exact label dimensions as defined during the label design process. The rendering quality of graphics in the PDF matches the resolution of the target printer and desired printout size.
Print stream data can be appended to an existing file, or it may overwrite it.
The action instructs NiceLabel 10 to redirect printing – as a result, the labels are not printed. Make sure the action is followed by the Print Label action.
Note
NiceLabel Automation module runs as service under defined Windows user account. Make sure this user account has privileges accessing the specified folder with read/write permissions. For more information, see section Access to Network Shared Resources in NiceLabel Automation user guide.
File group defines the redirect file.
-
File name: specifies the file name for diverting the print job to. If hard-coded, the printing is redirected to the specified file every time. To define it dynamically, use an existing or create a new variable.
-
Overwrite the file: if the specified file already exists on the disk, it is going to be overwritten (selected by default).
-
Append data to the file: the job file is appended to the existing data in the provided file (deselected by default).
-
Embed fonts in PDF: If you use some non-standard font, your solution might produce different PDF output on computers without this font. With Embed fonts in PDF option enabled, you embed your non-standard font into your solution and your solution creates the same PDF on all computers.
Embed fonts in PDF option creates PDF for Archiving (PDF/A) compliant document. The PDF/A standard ensures your documents are reproduced exactly the same way, regardless of what software you use. The information required for displaying the contents like images, fonts, and color information is embedded in your PDF file.
Note
The output PDF file consumes more space when saved with this option enabled.
Persistence group allows controlling the persistence of the redirect action. Define the number of Print Label actions that are affected by the Redirect Printing to File action.
-
Apply to next print action: specifies for the print redirect to be applicable to the next Print Label action only (single event).
-
Apply to all subsequent print actions: specifies for the print redirect to be applicable to all Print Label action defined after the current Redirect Printing to File action.
This action communicates with the printer to acquire its real-time state, and contacts the Windows Spooler for additional information about the printer and its jobs.
As a result, the information about errors, spooler status, number of jobs in the spooler is collected. This uncovers potential errors and makes them easy to identify.
Note
Possible use case scenarios. (1) Verifying the printer status before printing. If the printer is in an error state, you print the label to a backup printer. (2) Counting the number of jobs waiting in a spooler of the main printer. If there are too many, you will print the label to an alternative printer. (3) You will verify the printer status before printing. If the printer is in an error state, you will not print labels, but report the error back to the main system using any of the outbound actions, such as Send Data to TCP/IP Port, Send Data to HTTP, Execute SQL Statement, Web Service, or as the trigger response.
Live Printer Status Prerequisites
To make live printer status monitoring possible, follow these instructions:
-
Use the Loftware Printer Driver to receive detailed status information. If using any other printer driver, you can only monitor the parameters retrieved from the Windows Spooler.
-
The printer must be capable of reporting its live status. For the printer models supporting bidirectional communication see NiceLabel Download web page.
-
Printer must be connected to an interface with support for bidirectional communication.
-
Bidirectional support must be enabled in Control Panel > Hardware and Sound > Devices and Printers > driver > Printer Properties > Ports tab > Enable bidirectional support.
-
If using a network-connected label printer, make sure you are using Advanced TCP/IP Port, not Standard TCP/IP Port. For more information, see the Knowledge Base article.
Printer group selects the printer.
-
Printer name: specifies the printer name to be used for the current print job.
You can select a printer from the list of locally installed printer drivers, or you can enter any printer name. Data source enables variable printer name. When enabled, select or create a variable that contains the printer name when a trigger is executed or an event takes place. Usually, the variable value is assigned by a filter.
Data Mapping group sets the parameters that are returned as a result of the Printer Status action.
Warning
Most of the following parameters are only supported with Loftware printer drivers. If you are using any other printer driver, you can use only the spooler-related parameters.
-
Printer status: specifies the printer live status formatted as a string.
If the printer reports multiple states, all states are merged into a single string, delimited by comma ",". If there are no reported printer issues, this field is empty. Printer status might be set to Offline, Out of labels or Ribbon near end. Since there is no standardized reporting protocol, each printer vendor uses proprietary status messages.
-
Printer error: boolean (true/false) value of the printer error status.
-
Printer offline: boolean (true/false) value of the printer offline status.
-
Driver paused: boolean (true/false) value of the driver pause status.
-
Loftware Driver: specifies boolean (true/false) value of the printer driver status. Provides information if the selected driver is a Loftware driver.
-
Spooler status: specifies the spooler status in a string form – as reported by the Windows system. The spooler can simultaneously report several statuses. In this case, the statuses are merged using comma ",".
-
Spooler status ID: specifies spooler status formatted as a number – as reported by the Windows system. The spooler can simultaneously report several statuses. In this case, the returned status IDs contains all IDs as flags. For example, value 5 represents status IDs 4 and 1, which translates to "Printer is in error, Printer is paused". Refer to the table below.
Tip
The action returns a decimal value, the values in the table below are in hex format, so you will have to do the conversion before parsing the response.
-
Table of spooler status IDs and matching descriptions
Spooler status ID (in hex)
Spooler status description
0
No status.
1
Printer is paused.
2
Printer is printing.
4
Printer is in error.
8
Printer is not available.
10
Printer is out of paper.
20
Manual feed required.
40
Printer has a problem with paper.
80
Printer is offline.
100
Active Input/Output state.
200
Printer is busy.
400
Paper jam.
800
Output bin is full.
2000
Printer is waiting.
4000
Printer is processing.
10000
Printer is warming up.
20000
Toner/Ink level is low.
40000
No toner left in the printer.
80000
Current page can not be printed.
100000
User intervention is required.
200000
Printer is out of memory.
400000
Door is open.
800000
Unknown error.
1000000
Printer is in power save mode.
-
Number of jobs in the spooler: specifies the number of jobs that are in the spooler for the selected printer.
-
Loftware driver extended printer status: returns printer status and errors data in JSON format. Data includes also printer parameters like firmware version, printhead distance, and ink level.
Note
You need the latest Loftware driver to get the Loftware driver extended printer status.
Example 45. Example
NiceLabel Automation returns the following JSON content:
{ "printerName":"Production_printer_09", "version":"1", "responseType":"status3", "overallStatus":"error", "operationState":"pause", "printerType":"Thermal Transfer Label Printer", "deviceStatus": [ { "item": "fatalError", "type": "string", "internalId":"ERR_PAPER_OUT", "shortString":"Paper Out", "longString":"Printer is out of paper." }, { "item": "error", "type": "string", "internalId": "ERR_RIBBON_OUT", "shortString": "Ribbon Out", "longString": "Printer is out of Ribbon." } ], "deviceParameters": [ { "item":"state", "type":"float", "internalId":"INFO_PRINTHEAD_DISTANCE", "unit": "meter", "value": 789, "shortDescription":"Printhead distance", "longDescription":"Distance of printhead usage." }, { "item": "state", "type": "string", "internalId": "INFO_FW", "unit": "", "value": "FW27.3.13", "shortDescription": "Firmware version", "longDescription": "The version of the Firmware loaded on the printer." }, { "item": "property", "type": "integer", "internalId": "INFO_PRINT_DISTANCE", "unit": "seconds", "value": 16004, "shortDescription": "Print Distance", "longDescription": "Print Distance that the printer printed since odometer reset." } ] }
This action saves label template in the printer memory. The action is a vital part of Store/Recall printing mode, using which you first store a label template into the printer's memory and later recall it. The non-changeable parts of label design are already stored in the printer, so you only have to provide the data for variable label objects at print time. For more information, see section Using Store/Recall Printing Mode in NiceLabel Automation user guide.
Note
The required label data transfer time is greatly minimized as there is less information to be sent. This action is commonly used for stand-alone printing scenarios, where the label is stored to the printer or applicator in the production line and later recalled by some software or hardware trigger, such as barcode scanner or photocell.
Advanced options for storing label to printer group allows you select a label and the preferred storing variant.
-
Label name to be used on the printer: specifies the name to be used for storing the label template in printer memory. Enter the name manually or enable Data source to define the name dynamically using an existing or newly created variable.
Warning
When storing the label to a printer, it is recommended to leave the label name under the advanced options empty. This prevents label name conflicts during the recall label process.
-
Store variant: defines printer memory location for stored label templates. Enter the location manually or enable Data source to define the name dynamically using an existing or newly created variable.
The Print PDF Document action prints static PDF documents that are not linked to the labels in your PowerForms solutions or NiceLabel Automation configurations. Use this action to print any PDF document directly from your solutions or configurations. The PDF documents can be stored on:
-
Your computer
-
NiceLabel Control Center
-
Web server
-
Shared network drives
Tip
The action is useful if you plan to equip your packages with printed PDF reports on included items, or if you want to print the packaging documentation without opening the file browser.
Note
When in use, the Print PDF Document action takes one printer seat from your license quota. Read the NiceLabel licensing document for more information on licensing.
Printer group specifies the printer name to be used for the current print job.
-
Printer name: select it from the list of locally installed printer drivers, or manually enter a printer name. Select Data source to dynamically select the printer using a variable. If enabled, select or create a variable that contains the printer name which is used if the action is run.
File group defines the redirect file.
-
File name: specifies which PDF to print.
Note
Use the UNC syntax for network resources. For more information, see section Access to Network Shared Resources in NiceLabel Automation User Guide.