Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Printing to dot matrix
Message
De
15/08/2001 13:49:11
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00538025
Message ID:
00544205
Vues:
18
hi Sam

i have an app where 'tickets' are printed in draft mode to a dm printer. the easiest and fastest way to accomplish this is with the CopyFile API. below is a working example that can be fleshed out to suite your needs. what you do is write the report by hand like in the old days, with all the printer codes you want, and then print it to a text file. use the CopyFile() API to send it to the printer. with all the epson printers (and many other brands), i have found that the FX-80 printer driver works fine as a 'generic' type driver.

if file("yourfile.txt")
DECLARE INTEGER CopyFile IN KERNEL32.DLL ;
STRING @SourceFileName, ;
STRING @DestFileName, ;
INTEGER bFailIfExists
CopyFile("yourfile.txt","LPT1:",0)
else
messagebox('File not available for printing...',0+48+0,'Printer Error....')
endi
*The following are valid examples of invoking CopyFile() after it was DECLARED:
*CopyFile('C:\MyFile','LPT1:',0) && LPT1:
*CopyFile('D:\Temp\MyFile','PRN:',0) && the default printer
*CopyFile('\\MyServer\MyShare\MyFile','\\SomeServer\SharedPrinter',0)

hth
john
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform