Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sending a PDF to a particular printer
Message
De
13/09/2003 04:45:40
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00828667
Message ID:
00828742
Vues:
18
>>>How can I send a pdf to a particular windows printer?


Wayne,

ShellExecute does it. The only problem I see is that an acrobat window is left behind
FileName = '\tmp\test.pdf'
PrinterName = getprinter()

?ShellExecute(0, 'printto', FileName, '"'+PrinterName+'"', 0, 0)
________________________________________________________________
The Printto command looks something like

"C:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe" /t "%1" "%2" "%3" "%4"

&& %1 : FileName
&& %2 : PrinterName
&& %3 : PrinterDriver
&& %4 : PrinterPort

We're using the first two params

ps : enclose all parameters in double quotes
You can find the printto command with regedit
HKEY_CLASSES_ROOT\AcroExch.Document\shell\printto\command

and AcroExch.Document can be found in
HKEY_CLASSES_ROOT\.pdf in Default


And, of course, you can also change the windows printer, print, and reset the windows printer to its old value
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform