Tickets

This forum is for eXpress++ general support.
Post Reply
Message
Author
MIGUELON
Posts: 147
Joined: Wed Feb 10, 2010 10:55 am

Tickets

#1 Post by MIGUELON »

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.

MIGUELON
Posts: 147
Joined: Wed Feb 10, 2010 10:55 am

Re: Tickets

#2 Post by MIGUELON »

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.

User avatar
rdonnay
Site Admin
Posts: 4868
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Tickets

#3 Post by rdonnay »

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.
The eXpress train is coming - and it has more cars.

User avatar
Tom
Posts: 1299
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: Tickets

#4 Post by Tom »

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.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

MIGUELON
Posts: 147
Joined: Wed Feb 10, 2010 10:55 am

Re: Tickets

#5 Post by MIGUELON »

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.

User avatar
rdonnay
Site Admin
Posts: 4868
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Tickets

#6 Post by rdonnay »

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.
The eXpress train is coming - and it has more cars.

MIGUELON
Posts: 147
Joined: Wed Feb 10, 2010 10:55 am

Re: Tickets

#7 Post by MIGUELON »

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.

Post Reply