Print Label

This action executes label printing. It must always be nested within the Open Label action. Nesting allows it to obtain the reference to the label that is going to be printed. This further allows you to keep multiple labels open at the same time, and enables you to specify which label should be printed.

After issuing this action, the label gets printed using the printer driver that is defined in the label template. If the defined printer driver is not found on the system, the label is printed using the system default printer driver. You can override the printer driver selection via Set Printer action.

To achieve high performance label printing, Loftware activates two settings by default:

  • Parallel processing. Multiple print processes are all carried out simultaneously. The number of background printing threads depends on the hardware; specifically on the processor type. Each processor core can accommodate a single printing thread. This default can be changed. For more information, see section Parallel Processing in Loftware Automation user guide.

  • Asynchronous mode. As soon as the trigger pre-processing completes and the instructions for the print engine are available, the printing thread takes it over in the background. The control is returned to the trigger so it can accept the next incoming data stream as soon as possible. If synchronous mode is enabled, the control is not returned to the trigger until the print process is finished. This can take a while, but the trigger benefits from providing feedback back to data-providing application. For more information, see the section Synchronous Mode in Loftware Automation user guide.

    Note

    Using Save error to variable option in Action Execution and Error Handling does not yield any result in asynchronous mode, as the trigger does not receive feedback from the print process. To capture the feedback from the print process, enable synchronous mode first.

Note

If the Print Label action is nested under a For Loop action, Automation executes it in session printing mode. This mode acts as a printing optimization mode that prints all labels in a loop using a single print job file. For details, see Session Printing section in Loftware Automation user guide.

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.

Quantity group defines the number of labels to be printed using the active form.

  • Labels: sets the number of printed labels. Data source specifies or adds a variable that defines the label print quantity dynamically.

    Note

    Variable value is usually assigned by the Use Data Filteraction and must be integer.

All (unlimited quantity): depending on the label template design, the labels are printed in various quantities.

Unlimited Quantity Printing Details

Typically, this option is used in two scenarios.

  1. Command the printer to continuously print the same label until it is switched off, or after it receives a command to clear its memory buffer.

    Warning

    This scenario requires Loftware printer driver to be installed and used for label printing.

    If printing a fixed label, just a single print job is sent to the printer, with the quantity set to "unlimited". Label printers have a print command parameter which indicates "unlimited" printing.

    If the label is not fixed, but includes objects that change during the printing, such as counters, the printed quantity is set to maximum quantity supported by the printer. Loftware printer driver is aware of the printer quantity limit and print as many labels as possible.

    Example

    Maximum supported print quantity is 32,000. This is the amount of labels that are print after selecting the All (unlimited quantity) option.

  2. The trigger doesn't provide any data, but only acts as a signal for "event has happened". The logic to acquire necessary data is included in the label. Usually, a connection to a database is configured on the label, and at every trigger the label must connect to the database, and acquire all records from the database. In this case, the All (unlimited quantity) option is understood as "print all records from the database".

  • Variable quantity (defined from label variable): specifies a label variable that defines the label quantity to be printed.

    The trigger doesn't receive the number of labels to be print, so it passes the decision to the label template. The label might contain a connection to a database, which provide the label quantity, or there is another source of quantity information. A single label variable must be defined as "variable quantity".

Advanced group defines label printing details. Click Show advanced print options to define the Advanced print options:

This section specifies non-frequently used label quantity related settings.

  • Number of skipped labels: specifies the number of labels that are skipped on the first page of labels. The sheet of labels might have been printed once already, but not entirely. You can re-use the same sheet by offsetting the starting position. This option is applicable, if you print labels to sheets of labels, not rolls of labels, so it's effective for office printers and not for label printers.

  • Identical label copies: specifies the number of label copies to be printed for each unique label. For fixed labels, this option produces the same result as the main Number of Labels option. For variable labels, such as labels using counters, you can get the real label copies.

  • Label sets: specifies how many times the entire label printing process should repeat.

    Example

    Trigger or event receive content with 3 lines of CSV-formatted data, so 3 labels are expected to be printed (1, 2, 3). If you set this option to 3, the printout is done in the following order: 1, 2, 3, 1, 2, 3, 1, 2, 3.

Tip

All Advanced group values can either be hard-coded, or dynamically provided by an existing or a newly added variable.

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.

  • Example

    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.

  • 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.