[Gambas-user] How to sent a line line to a lp1 printer and form to lp0 printer directly.

Benoît Minisini gambas at ...1...
Tue Sep 22 21:52:37 CEST 2009


> Hello,
> 
> I want to print one line each time in order to keep the entrance book of a
> little hotel.
> I want to print one line each time.
> How can I do it?
> With SHELL command it can only print files.
> I have tried:
> 
> SHELL "lp1 tEpitheto.Text" WAIT
> 
> (where tEpitheto.Text is the text I want to print)
> 
> but it doesn't work!
> 

What kind of printer do you use?

I'm afraid that only old printers with pins is able to do that.

If you have such one, you can bypass the printing system and sends your 
characters directly to /dev/lp0.

> I also want to print a reciept form directly to a second printer at lp0
> I know that I can do it with :
> 
> Draw.Begin(Printer)
> Draw.Text(tEpitheto.Text & " " & tOnoma.Text & " " & tEthnikotita.Text,
>  200, 200)
> Draw.End
> 
> But is this normal to print with Draw.Begin(Printer) ? What will happen if
> I change the lp ports? Is there any other way to print directly to a port
> like Draw.Begin(lp0)?

Draw.Begin(Printer) ... Draw.End actually generates a postscript file that is 
sent then to the printing system. Only him knows how to transform the ps file 
into something that the printer will understand, how to send the data to the 
printer, and on which device.

Regards,

-- 
Benoît Minisini




More information about the User mailing list