General information
Category:
Reports & Report designer
Hi!
How can I print text with printer control sequences (PCL codes) to USB
printer bypassing printer driver? I have found this code:
#DEFINE C_OUT_PORT "prn.dos"
******************* Or:
*#DEFINE C_OUT_PORT "PRN:" &&- default
*#DEFINE C_OUT_PORT "LPT1:" &&- LPT1
*******************
DECLARE INTEGER CopyFile IN KERNEL32.DLL ;
STRING lpExistingFileName, ; && name of an existing file
STRING lpNewFileName, ; && name of new file
INTEGER bFailIfExists && operation if file exists
IF CopyFile("winpage.$$$", C_OUT_PORT, 0) # 0
ACTIVATE SCREEN
?CHR(7)
=MessageBox('Error!', 16, _SCREEN.Caption)
ELSE
WAIT WINDOW 'Ok!' NOWAIT
ENDIF
CLEAR DLLS
*winpage.$$$ is my text file with PCL codes
It did perfect job with non-USB printers. But when I tried to print to a USB
printer it failed...
If the USB virtual printer port is "USB001", a text file with the same name
is created.
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only