Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Printing On Dot Matrix Printer From VFP
Message
De
16/07/2001 13:31:36
 
 
À
16/07/2001 00:45:11
Devrishi Bhogra
Escorts Claas Limited
Faridabad, Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00529557
Message ID:
00531104
Vues:
11
hi Devrishi

try this... it uses windows API and gets rid of the ejected page.

set cons off &&before you start processing the info to print
set print to "yourfilemane" &&print it to a file for now
set print on

*insert your print stuff here

set print off
set printer to
if file("yourfilename")&&if it printed to the file...
DECLARE INTEGER CopyFile IN KERNEL32.DLL ;
STRING @SourceFileName, ;
STRING @DestFileName, ;
INTEGER bFailIfExists
if ldmp &&a var to tell if the dm printer is local
CopyFile("yourfilename","LPT1:",0)&& print the file to your printer
else && a var holding the path you your dm printer
CopyFile("yourfilename",&dmpath,0)
endi
set cons on
else
messagebox('An error occured while trying to print...',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)

it works for me on w9x and w2k
using this, you get the bonus of not having to use a generic printer driver that will not process your printer control codes. i find that the epson fx80 driver works for all the epson printers i have ever come across as well as most other brands.

best - john
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform