Printing to Datamax printer - part II

forum.sourcecode (2000-2005) & forum.td.sourcecode (2005-2010)
Roberto

Printing to Datamax printer - part II

Post by Roberto » 03 Mar 2006, 14:37

 Posted by:  Roberto 

Hey all,
I have read the messages regarding on printing to a Datamax printer and
understood that for my purposes the best option is to print my labels using
the seagull driver. I have have created a QRP for my labels, but here is
the problem:
I need to print an Aztec barcode in my label. This font is installed only
in the printer (printer-native). In Report Builder, whenever I have Datamax
printer as Windows default printer, I can choose the font datamax-Aztec to
put in a Field object.
The problem happens when I print the labels, because only the numbers are
printed, not the barcode.

Anyone can help me?

P.S: I am using CTD 1.5.1 PTF6

Pedro Vazquez

Re: Printing to Datamax printer - part II

Post by Pedro Vazquez » 03 Mar 2006, 18:51

 Posted by:  Pedro Vazquez 

Roberto,

To use the native fonts from the printer you have to send the commands
directly to the printer... you should read some post about that opening LPT1
or COM1 with SalFileOpen and sending the commands with SalFileWrite....

Hope it helps...

Regards,

Pedro E. Vazquez
Buenos Aires Software S.A. -- www.bas.com.ar
Argentina

Roberto

Re: Printing to Datamax printer - part II

Post by Roberto » 08 Mar 2006, 16:26

 Posted by:  Roberto 

Thanks for your help, Pedro,
I'll use direct commands printing...
It seems you are very familiar to Datamax printer, so here is what I need
to do:
I need to have full control of the printer (paper status, online status,
if a ticket was printed or not, if there was an error printing the
tickets, etc).

Have you implemented all of this using direct commands printing? Would
you have a code sample?

Thanks,
Roberto

Pedro Vazquez

Re: Printing to Datamax printer - part II

Post by Pedro Vazquez » 08 Mar 2006, 18:22

 Posted by:  Pedro Vazquez 

Roberto,

For specific commands you should see the user manual of your Datamax
printer...
For generic commands I'll send you a programm that generates the code for
you...
You only have to send the string generated to the port using SalFileOpen,
SalFileWrite....... here is a sample using api functions

!!CB!! 70
Set nComHandle = CreateFileA( 'COM1', GENERIC_WRITE, 0, 0, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, 0 )
If nComHandle = INVALID_HANDLE_VALUE
! get window error
Set nErr = GetLastError()
Call SalMessageBox( "Error opening COM1 ", "ERROR", MB_Ok )
Return FALSE

Call WriteFile( nComHandle, strText, SalStrLength(strText), nSent, 0 )
! Call PurgeComm( nComHandle, PURGE_TXABORT | PURGE_RXABORT | PURGE_TXCLEAR
| PURGE_RXCLEAR )
Call FlushFileBuffers( nComHandle )
Call CloseHandle( nComHandle )
Set nComHandle = -1

Enjoy it!

Pedro E Vazquez
Buenos Aires Software S.A. -- www.bas.com.ar
Argentina

Return to “td.sourcecode”

Who is online

Users browsing this forum: [Ccbot] and 0 guests