Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sending a PDF to a particular printer
Message
From
13/09/2003 04:45:40
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00828667
Message ID:
00828742
Views:
19
>>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform