Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
Welcome to the Monastery
 
PerlMonks  

Perl and Serial Printer

by shadox (Priest)
on Apr 17, 2004 at 18:32 UTC ( #346002=perlquestion: print w/ replies, xml ) Need Help??
shadox has asked for the wisdom of the Perl Monks concerning the following question:

Hello all,
Like 3 years ago i wrote a P.O.S using perl, the POS works
under apache, anyway, one of the things i have to do is to
print the invoice ( or how you call them ), using a serial
printer, this is easy doing something like

print COM1 "Some data\n";

The data just go as pure text to the printer by serail port
and thats it, but now i need to change the font size, but i
have no idea how to do it, i;ve search with no good results,
if anyone has an approach or know a module to do that it
will be great.

Thanx

___________________________________________
Optimus magister, bonus liber

Comment on Perl and Serial Printer
Download Code
Re: Perl and Serial Printer
by diskcrash (Hermit) on Apr 17, 2004 at 18:56 UTC
    Yo Shadox,

    Things like font sizes, italics, bold etc. generally come from escape sequences such as those found for the DEC VT100 character set. You need to locate the manufacturer(s) of the printer(s) that you are interested in to get the appropriate control codes to set these attributes. You generally "set attribute" with one command and "unset attribute" with another. The tough part is you have to intersperse your text with the appropriate commands, which is the kind of thing Perl was designed for.

    You may also have to be sure the printer is in the "right state" with reset commands before printing. At least invoices and receipts are of a fairly uniform style for printing. In some case you can download crude logos too. We did this with an NEC printer attached to a serial terminal for a County Recorders office system. Good luck.

    Diskcrash

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://346002]
Approved by TStanley
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2014-04-23 23:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (557 votes), past polls