charlesg ha scritto: > Hi, > > I tried printing line-by-line directly to the raw device and got into awful > overlapping (? buffering) problems. > > I think you would be far better to create a single line text file each time > and then print it with (for example): > SHELL "cat /home/charles/tilRcpt>/dev/lp0" > > It's blindingly quick and for me is absolutely reliable. As usual, I am sure > there are more elegent solutions :) > > I also had to set write permission to the device in form_open something > like: > SHELL "gksu -u root 'chmod a+rw /dev/lp0'" > Its a pain to have to supply a password, but it only does it once. > > Beware... I don't know if your overlapping problem is caused by buffering (I don't think so), but I am sure that in unix, text line are terminated by a single LF (line feed). For the printer, it means to go a line down, but not to reposition the printing head to the beginning of the line. What you obtain if you fail to do so, is something like this:
line1 line2 line3 It depends also on the kind of printer. I am sure that all old impact printer do so; the most modern ones, perhaps using postscript directly, can behave differently. You must add a CR (carriage return) to correctly print lines of text on an impact printer. Regards, Doriano ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user