NAME

Printer::ESCPOS::PDF - a hacky drop-in replacement for redirect Printer::ESCPOS output to a PDF file instead of a printer

SYNOPSIS

use Printer::ESCPOS::PDF;

my $printer = Printer::ESCPOS::PDF->new({ width => 815 });

my $parser = XML::Printer::ESCPOS->new(
    printer => $printer,
);
$parser->parse(q#
     <escpos>
        <qr version="4" moduleSize="4">Dont panic!</qr>
    </escpos>
#);

$printer->save_pdf('test.pdf');

... or without XML::Printer::ESCPOS:

Printer::ESCPOS::PDF

my $printer = Printer::ESCPOS::PDF->new({ width => 815 });

$printer->text('this is an example');
$printer->lf();
$printer->bold(1);
$printer->text(q~this is some bold text~);
$printer->bold(0);

$printer->save_pdf('test.pdf');

METHODS

new

Takes an optional options hash reference for defining settings like height, width,

save_pdf $filename

Outputs the generated PDF file to the given file.

get_pdf

Returns the generated PDF as a string.

OTHER METHODS

This module implements other methods to do the actual conversion which are mostly overwritten from the original Printer::ESCPOS.

BUGS

This is a quite hacky implementation that I need to output the content of a print in a web browser. Many values are hard-coded and should be configurable.

SEE ALSO

AUTHOR

Dominic Sonntag <dominic@s5g.de>

COPYRIGHT AND LICENSE

This software is copyright (c) 2010 by E. Xavier Ample.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.