Command and Attribute JSON Reference

The Printing API defines a number of JSON member names for specific printer operations and label definitions.

Predefined Members for Printer Operations

These reserved member names describe common functionality like setting different fonts, adjusting timing delays to ensure proper printing, and performing standard printing operations like form feeds and new lines. These members can appear in either the DEFAULTS object or as one of the specific printer objects contained within the PRINTERS object. The table below describes the member name, the value type, and a brief description of how the Printing API uses that information.

These member values may be changed in the LINEPRINTERCONTROL JSON object to alter the behavior of the supported printers or to support third party printers.

These settings represent a broad range of printer features, and not all printers support all features. For more information on the features supported by your printer, see the printer user manual.

Operating Commands and Attributes

Attribute Name Type Use
Initialize byte array Command sent first just after opening the printer. Normally used to put the printer into a known state.
FormFeed byte array Command sent to the printer for a form feed.
NewLine byte array Command sent to the printer for a new line.
PreCloseDelay number Delay (in milliseconds) before a printer disconnect is actually performed after a call to disconnect the printer is made.
UseDoubleHWMask Boolean If true, uses logic that sends a command to the printer that contains a bitwise value to set DoubleHigh and DoubleWide on or off.
ValidateAttribOnFont Boolean If true, causes font attributes (such as double high and double wide if implemented as attributes) to persist when fonts change, even if a particular printer normally loses the font attributes when changing fonts.
ValidateAttribOnFormFeed byte array If true, causes font attributes (such as double high and double wide if implemented as attributes) to persist after a form feed even if a particular printer normally loses the font attributes when performing a form feed.
ValidateAttribOnNewLn Boolean If true, causes font attributes (such as double high and double wide if implemented as attributes) to persist after a new line, even if a particular printer normally loses the font attributes when performing a new line.

Font Commands and Attributes

Attribute Name Type Use
BoldDotsHigh number The height in printer dots of the bold font.
BoldIsFont Boolean Used to determine if the font is implemented using a separate font or as a font attribute. Some printers use a completely different font for implementation. Others can apply an attribute to any font.
BoldOff byte array Command sent to the printer to turn font off and return to normal text.
BoldOn byte array Command sent to the printer to turn the font on.
CompressDotsHigh number The height in printer dots of the compressed font.
CompressIsFont Boolean Used to determine if the font is implemented using a separate font or as a font attribute. Some printers use a completely different font for implementation. Others can apply an attribute to any font.
CompressOff byte array Command sent to the printer to turn font off and return to normal text.
CompressOn byte array Command sent to the printer to turn the font on.
DoubleHighDotsHigh number The height in printer dots of the DoubleHigh font.
DoubleHighIsFont Boolean Used to determine if the font is implemented using a separate font or as a font attribute. Some printers use a completely different font for implementation. Others can apply an attribute to any font.
DoubleHighMask number Bit location to set on or off to control the DoubleHigh font attribute when "UseDoubleHWMask" is set.
DoubleHighOff byte array Command sent to the printer to turn font off and return to normal text.
DoubleHighOn byte array Command sent to the printer to turn the font on.
DoubleWideHighPrefix byte array Command sent to the printer before the "DoubleHighMask" and "DoubleWideMask" masked value to control the DoubleHigh font attribute when "UseDoubleHWMask" is set.
DoubleWideDotsHigh number The height in printer dots of the DoubleWide font.
DoubleWideIsFont Boolean Used to determine if the font is implemented using a separate font or as a font attribute. Some printers use a completely different font for implementation. Others can apply an attribute to any font.
DoubleWideMask number Bit location to set on or off to control the DoubleWide font attribute when "UseDoubleHWMask" is set.
DoubleWideOff byte array Command sent to the printer to turn font off and return to normal text.
DoubleWideOn byte array Command sent to the printer to turn the font on.
ItalicDotsHigh number The height in printer dots of the Italic font.
ItalicIsFont Boolean Used to determine if the font is implemented using a separate font or as a font attribute. Some printers use a completely different font for implementation. Others can apply an attribute to any font.
ItalicOff byte array Command sent to the printer to turn font off and return to normal text.
ItalicOn byte array Command sent to the printer to turn the font on.
NormalDotsHigh number The height in printer dots of the Normal font.
NormalFont byte array Command sent to the printer to initiate the Normal font.
NullsBeforeClose number Number of NULL characters to send to the printer before closing the connection. On some printers, these extra characters ensure that the entire buffer is flushed to the printer before the connection is lost.
StrikeoutDotsHigh number The height in printer dots of the Strikeout font.
StrikeoutIsFont Boolean Used to determine if the font is implemented using a separate font or as a font attribute. Some printers use a completely different font for implementation. Others can apply an attribute to any font.
StrikeoutOff byte array Command sent to the printer to turn font off and return to normal text.
StrikeoutOn byte array Command sent to the printer to turn the font on.
UnderlineDotsHigh number The height in printer dots of the Underline font.
UnderlineIsFont Boolean Used to determine if the font is implemented using a separate font or as a font attribute. Some printers use a completely different font for implementation. Others can apply an attribute to any font.
UnderlineOff byte array Command sent to the printer to turn font off and return to normal text.
UnderlineOn byte array Command sent to the printer to turn the font on.

Graphics Commands and Attributes

Attribute Name Type Use
PrintHeadWidth number

Width (in printer dots) of the printhead.

EndOfGraphicsDelay number Delay (in milliseconds) after the last graphics line is printed, but before the command to leave graphics mode is sent.
PostGraphicsDelay number Delay (in milliseconds) after the command to leave graphics mode is sent, but before a flush call.
PostGraphicsLineDelay number Delay (in milliseconds) after each single graphics line of data is sent.
PreGraphicsDelay number Delay (in milliseconds) before command is sent to the printer to initiate graphics.
StartOfGraphicsDelay number Delay (in milliseconds) after command to initiate graphics but before any graphics data is sent.

Bar Code Commands and Attributes

Attribute Name Type Use
Code39NarrowWidth number Width (in printer dots) of the narrow bars in a Code 39 bar code. Generally, wide bars are 2 or 3 times the width of narrow bars in Code 39.
Code39WideWidth number Width (in printer dots) of the wide bars in a Code 39 bar code. Generally, wide bars are 2 or 3 times the width of narrow bars in Code 39.
Code128NarrowWidth number Width (in printer dots) of the narrowest bars in a Code 128 bar code. A Code 128 bar code can contain bars that are up to four times as wide as the narrowest bar, so this value should generally be 1,2, or 3 (to prevent the bar code from exceeding the page width.

Predefined Members for Label Definitions

This table summarizes the predefined members for label definitions. For more information, see Label Printing Commands and Attributes.

Member Name Type Use
InvokeFormat string String containing printer language-specific commands to invoke a label layout format stored on the printer to print the label.
LabelDataStream string String containing printer language-specific commands to print the label.
StoreFormat string String containing printer language-specific commands to store the label layout format on the printer.
VarPrefix string String containing the variable name prefix.
VarPostfix string String containing the variable name postfix.