Page 1 of 2
How to use those printer control commands ?
Posted: Wed Nov 03, 2010 5:03 am
by huangchenmin
Hello everyone:
I need to work with a printer, which will printer number for people waiting in line.
Attachment is the commands maunal. I can't figure out how to use those control command in HMG code block.
Could anyone help!
Best Regards
Re: How to use those printer control commands ?
Posted: Wed Nov 03, 2010 7:43 am
by Rathinagiri
I don't understand your requirement. I think the command manual is for printing in dot matrix printer in dos mode?
Re: How to use those printer control commands ?
Posted: Wed Nov 03, 2010 8:05 am
by huangchenmin
rathinagiri wrote:I don't understand your requirement. I think the command manual is for printing in dot matrix printer in dos mode?
this printer is much similar to FAX machine, which enhance text with heat rather than dot martix.
I take it as normal laser jet or ink printer and print data normal and well.
Now i need to do is "cut paper" when printing finished.
What knid of form my prg code block should be ?
Please help!
best regards
chen min
Re: How to use those printer control commands ?
Posted: Wed Nov 03, 2010 8:21 am
by Rathinagiri
You want automatically cut the paper after printing is finished?
Re: How to use those printer control commands ?
Posted: Thu Nov 04, 2010 3:40 am
by huangchenmin
rathinagiri wrote:You want automatically cut the paper after printing is finished?
Yes.
I wrote the situation in attachment!
Please Help!
Best Regards
chen min
Re: How to use those printer control commands ?
Posted: Thu Nov 04, 2010 3:56 am
by Rathinagiri
Since the printer is connected in LPT1 port, you can use the same command used in DOS mode here too. Had you tried?
Re: How to use those printer control commands ?
Posted: Thu Nov 04, 2010 8:14 am
by huangchenmin
rathinagiri wrote:Since the printer is connected in LPT1 port, you can use the same command used in DOS mode here too. Had you tried?
do you mean like this?
SELECT PRINTER "TM200PLUS" to lSuccess;
ORIENTATION PRINTER_ORIENT_PORTRAIT;
PREVIEW;
@ m_row+m_interval*1,m_col PRINT "ABCDEFG" FONT "標楷體" SIZE 10
fwrite(lSuccess,Chr(29)+chr(86)+Chr(66)+Chr(48)) //Partial cut
fclose(lSuccess)
I had tried and fail too. I think it is because of error handle of printer.
Re: How to use those printer control commands ?
Posted: Thu Nov 04, 2010 10:52 am
by Rathinagiri
Prior to HMG, had you used with Harbour code to print?
IMHO, you please try without any GUI component to print using console mode.
Re: How to use those printer control commands ?
Posted: Thu Nov 04, 2010 2:36 pm
by huangchenmin
rathinagiri wrote:Prior to HMG, had you used with Harbour code to print?
IMHO, you please try without any GUI component to print using console mode.
How could I have those info to coding?
Please Help!
Best Regards
chen min
Re: How to use those printer control commands ?
Posted: Thu Nov 04, 2010 2:41 pm
by miras
Hi!
Try this after your printing code.
SET CONS OFF
SET ALTE TO CUT.TXT
SET ALTE ON
?chr(27)+"i"+CHR(18) ///Cut if you can
SET ALTE OFF
SET ALTE TO
SET CONS ON
WinPrintRaw(cPrinter, "CUT.TXT", "CUT")
Hope that helps.
Best regards
Miras