Spooler Printing Language reference
SPL is a dynamic and versatile JSON-based printing language designed to simplify the interaction with the Spooler API. With SPL, users can seamlessly create print templates such as product and shipping labels, as well as send PDF documents to print on any printer connected to a Spooler hub. SPL brings a higher degree of flexibility, control, and efficiency to your printing processes.
Let's delve into the core features of the SPL:
Image
The Image feature of SPL allows users to display images in their printing tasks. With this feature, you have control over the placement and dimensions of the image.
align
The alignment property for images allows for the alignment of the image on the printing medium. Supported alignments include left, right, and center. By default, the alignment is set to left.
width
The width property for images allows the specification of the image's width. The default width is 500, and any integer can be used to adjust the width.
height
The height property for images allows the specification of the image's height. The default is null, implying that any integer can be used to set the height.
url
The URL property for images specifies the source URL for the image file. This should be a string containing the URL of the image to be printed.
text
The Text feature allows users to incorporate text into their printing tasks. This feature provides control over the text content, alignment, height, font, and style.
data
The data property for text specifies the text to be printed.
align
The alignment property for text allows for the alignment of the text on the printing medium. Supported alignments include left, right, and center. By default, the alignment is set to left.
height
The height property for text allows the specification of the line-height for the text. The default height is 1, but it can be adjusted by specifying any integer.
font
The font property allows users to specify the font to be used for the text. The options include 'a' and 'b', with 'b' being the default.
style
The style property defines the style of the text. Options include 'normal' and 'bold', with 'normal' being the default.
Line
The Line feature is a simple tool that allows users to add a horizontal line into their printing tasks. This feature doesn't have any properties as it's designed for simplicity and quick usage.
Feed
The Feed feature enables users to control the vertical spacing between elements in the printout.
height
The height property for feed allows the specification of the line-feed height. The default height is 1, but it can be adjusted by specifying any integer.
Table
The Table feature provides the functionality to print tabular data, offering control over the columns of the table.
columns
The columns property allows users to specify the columns of the table. This should be an array of text elements, each representing a column.
Barcode
The `barcode` feature is used to include barcodes in the template. The data field takes a string as an input and there are no restrictions on alignment or width properties.
Data
The data property in the barcode feature is supported and required. It holds a string data type and does not have any default value.
Width
The width property for the barcode feature is supported and takes an integer as a value. It is optional and does not have a default value. This allows you to define the width of the barcode in your template.
Height
The height property for the barcode feature is supported and takes an integer as a value. It is optional and does not have a default value. This allows you to define the height of the barcode in your template.