Skip to content

An XML language for generating calls to Printer::ESCPOS

Notifications You must be signed in to change notification settings

sonntagd/XML-Printer-ESCPOS

Repository files navigation

XML::Printer::ESCPOS

Build Status Coverage Status

DESCRIPTION

This module provides a markup language that describes what your ESCPOS printer should do. It works on top of the great and easy to use Printer::ESCPOS. Now you can save your printer output in an XML file and you can write templates to be processed by Template Toolkit or the template engine of your choice.

SYNOPSIS

use Printer::ESCPOS;
use XML::Printer::ESCPOS;

# connect to your printer, see Printer::ESCPOS for more examples
my $device = Printer::ESCPOS->new(
    driverType => 'Network',
    deviceIp   => '192.168.0.10',
    devicePort => 9100,
);

my $parser = XML::Printer::ESCPOS->new(printer => $device->printer);
$parser->parse(q#
<escpos>
    <bold>bold text</bold>
    <underline>underlined text</underline>
</escpos>
#) or die "Error parsing ESCPOS XML file: ".$parser->errormessage;

$device->printer->cutPaper();
$device->printer->print();

HOW TO WRITE ESCPOS XML FILES

The XML file should be enclosed in <escpos> ... </escpos> tags.

TODO

See the separate ToDo list here.

INSTALLATION

To install this module, use cpanm:

cpanm XML::Printer::ESCPOS

SUPPORT AND BUGS

Please report any bugs or feature requests by opening an issue on Github.

LICENSE AND COPYRIGHT

Copyright (C) 2017 Dominic Sonntag.

This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at:

http://www.perlfoundation.org/artistic_license_2_0