How to print directly to LPT or USB without report

Discussion forum about all things Report Builder (all versions).
Dietmar
Germany
Posts: 102
Joined: 12 Apr 2018, 14:47
Location: Bielefeld, Germany

How to print directly to LPT or USB without report

Post by Dietmar » 30 Aug 2013, 07:19

Hello,

i would like to know if it is possible to send characters directly to a printer on LPT or USB port, completely without report and all these things.
Our customer would like to use a receipt printer with interface for a cash drawer.
For this reason we have to send strings to this printer (for fast printing with its native font) and special characters (to cut the paper and open the cash drawer).
I am quite sure that i read something like this in this forum, but i cannot find it again.

Thanks for yout help.

Dietmar Teich

MSchmidt
Germany
Posts: 299
Joined: 03 Jul 2017, 09:28
Location: Germany

Re: How to print directly to LPT or USB without report

Post by MSchmidt » 30 Aug 2013, 11:43

just an idea:

maybe you could build a file (txt) with the special characters inside.

then you can send this file to the printer with:
ShellExecuteA( hWndForm, 'print', strFilePath, STRING_Null, STRING_Null, 0)

or the equivalent unicode version of shellexecute

regards
M.Schmidt

FRBhote
India
Posts: 2208
Joined: 09 Mar 2017, 05:32
Location: Hyderabad, India

Re: How to print directly to LPT or USB without report

Post by FRBhote » 30 Aug 2013, 12:50

If it is LPT, you can use:

Call SalFileOpen( hFile, 'PRN', OF_Write | OF_Create )

Call SalFilePutStr( hFile, String )

holger.mueller
Austria
Posts: 198
Joined: 28 Aug 2017, 09:36
Location: Brunn am Gebirge, Austria

Re: How to print directly to LPT or USB without report

Post by holger.mueller » 02 Sep 2013, 10:00

1. LPT - SalFileOpen
2. COM - Handling COM-Interface over WinAPI
3. USB - Sending RAW-Data tp printer over WinAPI, have a look at OpenPrinter, StartDocPrinter, WritePrinter, EndPage, EndDoc and ClosePrinter (if you need sample-code, just send me a pm).

Greetings

Holger

Dietmar
Germany
Posts: 102
Joined: 12 Apr 2018, 14:47
Location: Bielefeld, Germany

Re: How to print directly to LPT or USB without report

Post by Dietmar » 03 Sep 2013, 10:56

Thanks to all for your kind help.
I will start to experiment in the next days.
Maybe i will have some more questions because working with hardware ports is completely new to me.

Dietmar Teich

BobbyDowns

Re: How to print directly to LPT or USB without report

Post by BobbyDowns » 06 Nov 2013, 00:51

Is there a reason you are not using the device driver to fire the cash draw and cut the paper?
It works fine on all the applications I write for Epson, Ithaca and Star receipt printers/cash drawers.

Dietmar
Germany
Posts: 102
Joined: 12 Apr 2018, 14:47
Location: Bielefeld, Germany

Re: How to print directly to LPT or USB without report

Post by Dietmar » 06 Nov 2013, 10:53

Hello BobbyDowns,

thanks for your answer.
Actually i do not have the printer in my office for testing.
So i don't know what the driver is able to do.

Can you also print to the receipt printer with its native font using the driver?
What about printing graphics?

Dietmar Teich

FRBhote
India
Posts: 2208
Joined: 09 Mar 2017, 05:32
Location: Hyderabad, India

Re: How to print directly to LPT or USB without report

Post by FRBhote » 06 Nov 2013, 12:04

Using a regular QRP you can print to the printer and at the end of the report, the paper will cut also.

Again you can embed pictures in the qrp.

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 0 guests