Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
USB printing
Message
De
17/06/2003 01:34:55
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Titre:
USB printing
Divers
Thread ID:
00800688
Message ID:
00800688
Vues:
44
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.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform