Send Data to Printer
This action sends data to a selected printer. Use it to send pre-generated printer streams to any available printer.
Loftware Automation module uses the installed printer driver in pass-through mode just to be able to send data to the target port, such as LPT, COM, TCP/IP or USB port, to which the printer is connected.
Note
Possible scenario. Data received by the trigger must be printed out on the same network printer, but on different label templates (.NLBL label files). The printer can accept data from various workstations and will usually print the jobs in the received order. Automation Builder module will send each label template in a separate print job, making it possible for another workstation to insert its job between the jobs created in our own Automation Builder module. Instead of sending each job separately to the printer, merge all label jobs (using the action Redirect Printing to File) and send a single "big" print job to the printer.
About group identifies the selected action.
- Name: allows you to define a custom action name. This makes actions easily recognizable on the solution's list of actions. By default, the action name is taken from its type.
- Description: custom information about the action. Enter a description to explain the purpose and role of action in a solution.
- Action type: read-only information about the selected action type.
Printer group selects the printer.
-
Printer name: name of the printer to send the data to. Select the printer from the drop-down list of locally installed printer drivers, enter a custom printer name, or define it dynamically using an existing or newly created variable.
Data Source group defines the content to be sent to printer.
-
Use data received by the trigger: trigger-received data it used. In this case, you want the received printer stream to be used as an input to the filter. Your goal is to redirect it to a printer without any modification. The same result can be achieved by enabling the internal variable DataFileName and using the contents of the file it refers to. For more information, see section Using Compound Values in Loftware Automation user guide.
-
File name: path and file name of the file containing a printer stream. Content of the specified file is sent to a printer. Select Data source to define the file name dynamically using a variable value.
-
Variable: variable (existing or new) that contains the printer stream.
-
Custom: defines custom content to be sent to a printer. Fixed content, mix of fixed and variable content, or variable content alone are permitted. To enter variable content, click the button with arrow to the right of data area and insert a variable from the list. For more information, see section Combining Values in an Object in Loftware user guide.
Action Execution and Error Handling
Each action can be set as a conditional action. Conditional actions only run when the defined conditions allow them to be run. To define these conditions, click Show execution and error handling options.
Execution options are:
- Enabled: specifies if the action is enabled or disabled. Only enabled actions will execute. This functionality may be used while testing a form.
- Condition: defines one-line programming expression that must provide a Boolean value (true or false). When the result of the expression is true, the action will execute. Condition offers a way to avoid executing actions every time.
Error handling options are:
- Ignore failure: specifies whether an error should be ignored. If enabled, the execution of actions continues even if the current action fails.
Note
Nested actions that depend on the current action do not execute in case of a failure. The execution of actions continues with the next action on the same level as the current action. The error is logged but does not break the execution of the action.
- Save error to variable: allows you to select or create a variable to save the error to. The same cause of the error is also saved to internal variables ActionLastErrorId and ActionLastErrorDesc.
At the end of printing, you might want to send the status update to an external application using the HTTP Request action. If the printing action fails, action processing stops. In order to execute the reporting even after the failed print action, the Print Label action must have the option Ignore failure enabled.