Constructs a tags object.
Returns true if the given tag is defined.
Method for recursive parsing of tags.
Helper method for simple 0/1 switches.
Helper method to add global options to object options.
Prints plain text and strips out leading and trailing whitespaces.
Prints plain text. To activate automatic word wrapping, you can use the attribute wordwrap to set the word wrap width (use the maximum number of characters per line. When wordwrap is active, you can set the bodystart parameter to define the characters that should be printed at the beginning of each line (except the first one). You can use this to set some indentation.
Sets text to be printed bold.
Sets text to be printed double striked.
Sets text to be printed inverted.
Sets text to be printed underlined.
Sets Upside Down Printing.
Use this tag to use the second color (if support by your printer).
Prints a QR code. Possible attributes:
Prints a barcode to the printer. See Printer::ESCPOS::Manual for a list of possible options. The barcode content should be set as the tag content like <barcode>content</barcode>. All other options must be set as attributes.
Can print text with special styling. Use the parameters allowed in Printer::ESCPOS's method utf8ImagedText as attributes for the utf8ImagedText tag. In addition you can use the attribute wordwrap to set the word wrap width. By now, it is only possible to set the maximum number of characters per line. Later we should try to implement a wrapping based in the maximum pixel width of a line. When wordwrap is active, you can set the bodystart parameter to define the characters that should be printed at the beginning of each line (except the first one). You can use this to set some indentation.
Moves to the next line. If the lines attribute is given, move that number of lines.
Moves the cursor to next horizontal tab position.
Print image from named file.
Sets the print area width.
Sets global variables: paperWidth, wordwrap, fontFamily, fontSize, fontStyle, lineHeight, printAreaWidth
Resets global variables to standard values: paperWidth, wordwrap, fontFamily, fontSize, fontStyle, lineHeight, printAreaWidth Syntax: <unset fontStyle="" />
Adds a horizontal line. Use the thickness attribute to set the line's thickness. Defaults to 2.
Sets horizontal tab positions for tab stops. Syntax for XML is the following:
<tabpositions> <tabposition>5</tabposition> <tabposition>9</tabposition> <tabposition>13</tabposition> </tabpositions>
Repeats the content n times. Syntax:
<repeat times="3"> [tags to repeat] </repeat>
Set justification to left, right or center. Syntax for XML is the following: <justify align="right">text</justify>
Prints text in table format. By now, this tool is only helpful for monospaced fonts. Possible cell parameters are width (only in pattern row), colspan and align (right, left, center). Possible line parameters are fontStyle and align. Possible table parameters are fontSize, wordwrap, lineHeight, paperWidth, separator, leftBorder, rightBorder and fontStyle.
Checks validity of table tags and attributes. (Helper for table tag.)
Returns table rows and cells (options and content). (Helper for table tag.)
Calculates the width for each table column. (Helper for table tag.)
Breaks cell content if it doesn't fit column width and returns table rows and cells (options and content). (Helper for table tag.)
Choose font a, b or c.
Set font height.
Set font width.
Set character spacing.
Set line spacing.
Reverts to default line spacing for the printer.
Sets the distance from the beginning of the line to the position at which characters are to be printed.
Sets the left margin for printing.
Prints bit image stored in non-volatile (NV) memory of the printer.
Prints bit image stored in volatile memory of the printer.
To install XML::Printer::ESCPOS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XML::Printer::ESCPOS
CPAN shell
perl -MCPAN -e shell install XML::Printer::ESCPOS
For more information on module installation, please visit the detailed CPAN module installation guide.