Provides base functionality to interface with ZPL printers.
Current Version: 1.0.3.0as of Business Central 20.
Manual
Creation date: 2024/11/22 The current version of this manual can be found at:
☰ Contents
General
App ZPL Printer Management Base The app ZPL Printer Management Base defines tables and pages, to declare zpl printers and zpl layouts. The user can define the zpl printer to use for a distinct layout & username combination (similar to the Printer Selection in Business Central)...
Tasks
ZPL Printers On this page the user can define the available zebra printers as well as details for connecting to the specified printer...
ZPL Layouts On this page zpl layouts can be defined in a separate dialog with a text editor and testet via the actions Download or Test Print...
ZPL Layout Editor The layout must be specified in this editor in the ZPL format...
ZPL Printer Selections
Working with the App The Zebra Printer Management Base only provides basic functionality and tables...
Developer Information This app only provides basic functionality and entities as well as interfaces. The connection to a printer and the conversion of an image to zpl code has to be implemented in subapps...
Appendix
Release Notes
Docs / NVXZPL ZPL Printer Management Base / General General
The app ZPL Printer Management Base defines tables and pages, to declare zpl printers and zpl layouts. The user can define the zpl printer to use for a distinct layout & username combination (similar to the Printer Selection in Business Central).
Furthermore, this app defines functions to establish a connection with a specified printer, retrieve a specified zpl layout from the database, etc.
Prints the current layout on the zpl printer specified in the parameter.
Print(Text)
Prints the specified layout on the zpl printer according to the ZPL Printer Selection
GetNoOfPlaceholdersFromLayout(Text): Integer
Retrieves the no. of placeholders occuring in the layout.
ReplacePlaceholders(Text; List of [Text]): Text
Replaces the available placeholders within the layout with the specified list of values. The placeholders must be defined in the format %1-n. A placeholder in the zpl code is being replaced with the value, from whcih the index of the value within the list is equal to the placeholder identifier.
The layout must be specified in this editor in the ZPL format.
Example zpl layout:
^XA
^FX
^CF0,60
^FO50,50^GB100,100,100^FS
^FO75,75^FR^GB100,100,100^FS
^FO93,93^GB40,40,40^FS
^FO220,50^FDLorem ipsum^FS
^CF0,30
^FO220,115^FDdolor sit amet^FS
^FO220,155^FDconsetetur sadipscing^FS
^FO220,195^FD elitr, sed diam nonumy^FS
^FO50,250^GB700,3,3^FS
^XZ
To add dynamic contents to the zpl layout during the runtime, you can define placeholders on any position within the zpl layout via %[1-n]. For a more detailed explaination about placeholders and their functionality please read the Developer Information:
^XA
^FX
^CF0,60
^FO50,50^GB100,100,100^FS
^FO75,75^FR^GB100,100,100^FS
^FO93,93^GB40,40,40^FS
^FO220,50^FDLorem ipsum%1^FS
^CF0,30
^FO220,115^FDdolor sit amet%2^FS
^FO220,155^FDconsetetur sadipscing%3^FS
^FO220,195^FD elitr, sed diam nonumy%4^FS
^FO50,250^GB700,3,3^FS
^XZ
Docs / NVXZPL ZPL Printer Management Base / Tasks Working with the App
The Zebra Printer Management Base only provides basic functionality and tables.
To send zpl labels to a printer, one of the following apps must also be installed, because they provide the implementation to send files to a zpl printer:
Prior to printing zebra labels from business central ZPL Printer and ZPL Layouts have to be defined.
In the zebra printer selection, similar to the printer selection in business central, default printers can be defined to a combination of username and zebra layout code.
Based on this selection following printers are going to be selected based on the different username and layout combinations:
Is the current user not equal to TEST and the layout to print is not equal to TESTETIKETT, then the printer ZEBRA is being selected.
Is the current user not equal to TEST and the layout to print is equal to TESTETIKETT, then the printer ZEBRA4 is being selected.
Is the current user equal to TEST and the layout to print is not equal to TESTETIKETT, then the printer ZEBRA2.
Is the current user equal to TEST and the layout to print is equal to TESTETIKETT, then the printer ZEBRA3 is being selected
Docs / NVXZPL ZPL Printer Management Base / Tasks Developer Information
This app only provides basic functionality and entities as well as interfaces. The connection to a printer and the conversion of an image to zpl code has to be implemented in subapps.
Interfaces
This app provides following interfaces and corresponding enums:
ZPLIPrinterConnectorNVX
Enum: ZPLConnectionTypeNVX
Methods
Methodname
Description
Print(Text; Code[20])
Prints the zpl code in text format to the selected printer.
Converts and rotates an image from stream to zpl code
Print a ZPL Layout
On the table ZPLPrinterNVX the field "Connection Type" is defined, which implements the interface ZPLIPrinterConnectorNVX. This enum can be extended in subapps to support different connection methods to the printer.
procedure PrintLayout(LayoutCode: Code[20]; NoOfCopies: Integer)
var
ZPLLayout: Record ZPLLayoutNVX;
ZPLPrinter: Record ZPLPrinterNVX;
ZPLPrinterMgt: Codeunit ZPLPrinterMgtNVX;
PrinterCode: Code[20];
IZebraConnector: Interface ZPLIPrinterConnectorNVX;
Placeholders: List of [Text];
LabelLayout: Text;
begin
ZPLLayout.Get(LayoutCode);
ZPLPrinterMgt.GetPrinter(ZPLLayout.Code, PrinterCode); //determines the printer according to the ZPL printer selection
ZPLPrinter.Get(PrinterCode);
IZebraConnector := ZPLPrinter."Connection Type"; //connection to the printer must be implemented in subapps
Placeholders.Add('Test');
Placeholders.Add('Test2'); //Definition of the values that replace the placeholders. The placeholder %1 is being replaced with 'Test' and placeholder %2 is being replaced with 'Test2'.
LabelLayout := ZPLLayout.GetLayoutAsText();
ZPLLayout.SetNoOfCopiesForLayout(NoOfCopies, LabelLayout);
LabelLayout := ZPLLayout.ReplacePlaceholders(LabelLayout, Placeholders);
IZebraConnector.Print(LabelLayout, PrinterCode);
end;
Would you like to know what has changed in the extension? Below you'll find an overview of the new features and changes made in the updates.
Build-Overview in DevOps
NVXZPL 1.0.3.0
as of Business Central 20 2023/11/06
Improvements
Set Field LabelType from Table ZPL Layout to obsolete.
NVXZPL 1.0.2.0
as of Business Central 20 2023/11/06
Improvements
Removal of the field LabelType from Table ZPL Layout and Page ZPLLayouts.
NVXZPL 1.0.1.0
as of Business Central 20 2023/10/23
Improvements
Improve functionality to replace placeholders in the zpl layout table. Added Field LabelLayoutType - Enum for zpl layout table.
NVXZPL 1.0.0.1
as of Business Central 20 2023/06/21
Improvements
Improve functionality to replace placeholders in the zpl layout.