Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printing to dot matrix
Message
From
15/08/2001 13:49:11
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00538025
Message ID:
00544205
Views:
12
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform