Printer::ESCPOS::PDF
version 0.001
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');
Printer::ESCPOS::PDF - a hacky drop-in replacement for redirect Printer::ESCPOS output to a PDF file instead of a printer
Takes an optional options hash reference for defining settings like height, width,
Outputs the generated PDF file to the given file.
Returns the generated PDF as a string.
This module implements other methods to do the actual conversion which are mostly overwritten from the original Printer::ESCPOS.
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.
XML::Printer::ESCPOS
Printer::ESCPOS
Dominic Sonntag <dominic@s5g.de>
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.
This software is copyright (c) 2017 by Dominic Sonntag.
To install Printer::ESCPOS::PDF, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Printer::ESCPOS::PDF
CPAN shell
perl -MCPAN -e shell install Printer::ESCPOS::PDF
For more information on module installation, please visit the detailed CPAN module installation guide.