Hi everyone, I'm printing tickets in graphical mode like this:
@1.0 DCPRINT SAY "Test"
My question is, can I send ESC codes, i.e., chr(27) + ...
I want to control the paper cutting and drawer opening in graphical mode.
I have no problems in non-graphical mode.
Thanks for your help.
Tickets
Re: Tickets
Thanks for the reply, maybe I didn't explain myself well.
With @0.0 dcprint, I want to be able to cut the paper on a thermal receipt printer or open the cash drawer.
With @0.0 say, I know I can do it without any problems.
Thanks.
With @0.0 dcprint, I want to be able to cut the paper on a thermal receipt printer or open the cash drawer.
With @0.0 say, I know I can do it without any problems.
Thanks.
Re: Tickets
DCPRINT uses the Xbase++ XbpPrinter class which is bound to the Windows print engine.
Unfortunately, I am not aware of anything that allows embedding escape sequence inside the print job,
You should still be able to send the escape sequence after the print job is completed by writing a file to the LPT* device.
Unfortunately, I am not aware of anything that allows embedding escape sequence inside the print job,
You should still be able to send the escape sequence after the print job is completed by writing a file to the LPT* device.
The eXpress train is coming - and it has more cars.
Re: Tickets
It is possible, but very, very, very hard to mix using a printer driver and directly sending ESC codes within the same job. Normally, the driver will remove those characters - or do something else if it gets them.
You may use the RAW mode/spooler job type to send ESC codes between the other data, but this is extremly tricky, as I heard.
You may use the RAW mode/spooler job type to send ESC codes between the other data, but this is extremly tricky, as I heard.
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: Tickets
From what you've told me, I can't control using "dcprint" whether or not to cut the paper on a receipt printer or open the cash drawer.
If so, the only solution I have left is to configure the driver to do it for me and cut it when finished.
The problem is that I'm printing to a redirected printer because I'm connecting with a terminal server, and although I can set the redirection driver to how I want it to behave (forcing it to cut the paper), it's not very stable because the redirection can change from one connection to another.
That's why I wanted to take control from Xbase++.
Any suggestions?
Thanks for your time.
If so, the only solution I have left is to configure the driver to do it for me and cut it when finished.
The problem is that I'm printing to a redirected printer because I'm connecting with a terminal server, and although I can set the redirection driver to how I want it to behave (forcing it to cut the paper), it's not very stable because the redirection can change from one connection to another.
That's why I wanted to take control from Xbase++.
Any suggestions?
Thanks for your time.
Re: Tickets
Years ago, I modified an Xbase++ program that needed to open the cash drawer, but I don't remember what I did to make that happen.
I cannot even find the customer's code, but I may have it on an old drive.
I'll see what I can do.
The fact that you are running on a terminal server complicates things.
I cannot even find the customer's code, but I may have it on an old drive.
I'll see what I can do.
The fact that you are running on a terminal server complicates things.
The eXpress train is coming - and it has more cars.
Re: Tickets
Thanks for the reply, Roger.
I know how to open the drawer or cut the paper using:
SET PRINTER TO OBJECT or Printer
@ 0,0 SAY chr(27)...
SET printer TO
When I finish printing with dcprint or before starting, and it works perfectly.
The problem is that depending on the driver, for example with the paper cut, it can have 3 states.
1) Never count
2) Cut after printing
3) Cut each sheet
And I can't control which of the 3 the driver will choose. In principle, the default one or the one I assign to it in the redirected printer. But this isn't stable for me because it can change during a redirection. That's why I wanted to have control from Xbase++.
I can't find a way to set the driver values (from Xbase++) to be sure of their values. I know these parameters are saved in the Windows registry.
Okay, I won't bother you any more, thanks everyone.
I know how to open the drawer or cut the paper using:
SET PRINTER TO OBJECT or Printer
@ 0,0 SAY chr(27)...
SET printer TO
When I finish printing with dcprint or before starting, and it works perfectly.
The problem is that depending on the driver, for example with the paper cut, it can have 3 states.
1) Never count
2) Cut after printing
3) Cut each sheet
And I can't control which of the 3 the driver will choose. In principle, the default one or the one I assign to it in the redirected printer. But this isn't stable for me because it can change during a redirection. That's why I wanted to have control from Xbase++.
I can't find a way to set the driver values (from Xbase++) to be sure of their values. I know these parameters are saved in the Windows registry.
Okay, I won't bother you any more, thanks everyone.