Reputation: 31
I have a Star TSP100 printer and I'm having few problems with it really.
My problem is that I'm not as familiar with programming as I should be - but I'm learning!
The programmers reference for the Star printer says that if I send a ESC d to the printer - that will activate the built-in cutter - which I would like to do very much.
My problem is that I have no idea how to send an escape code like that from within Perl - if it's even possible.
I really appreciate any advice on this one.
Upvotes: 3
Views: 2009
Reputation: 14520
You can use my module Printer::Thermal from CPAN
https://metacpan.org/pod/Printer::Thermal
$printer = Printer::Thermal->new(serial_device_path=$path);
$printer->write("\x1d" . 'd'); # \x1d is ESC
$printer->print;
BTW esc d is used for print and feed lines
You can use the inbuilt function cutpaper to make things simpler
$printer->cutpaper;
$printer->print;
Upvotes: 0
Reputation: 240284
Escape is just a character; it can be written (among other things) as "\e"
or "\033"
. So assuming you have a handle open to the printer device, all you need is to print $fh "\ed"
.
Upvotes: 6
Reputation: 4587
It's written in Clipper but fairly easy to understand since it uses the standard Windows Printing API, callable in 99% of Win32 programming languages.b
Upvotes: 0