How can I print a acrobat file (*.pdf) from delphi to a specific printer
(not always default printer) without changing the default printer.
My app is a QManager that does all the printing for our applications.
I'm using D4.
Thanks
Didi : Rud...@limon.co.za
<quote>
HKEY_CLASSES_ROOT
wrifile = Write Document
shell
open
command = C:\Progra~1\Access~1\WORDPAD.EXE %1
print
command = C:\Progra~1\Access~1\WORDPAD.EXE /p "%1"
printto
command =
C:\Progra~1\Access~1\WORDPAD.EXE /pt "%1" "%2" "%3" "%4"
In the preceding commands, the %1 parameter is the filename, %2 is the
printer name, %3 is the driver name, and %4 is the port name. In Windows
95, you can ignore the %3 and %4 parameters (the printer name is unique in
Windows 95).
</quote>
So you need to pass some parameters in addition to the document name to
ShellExecute for the printto action.
var
Device : array[0..255] of char;
Driver : array[0..255] of char;
Port : array[0..255] of char;
S: String;
hDeviceMode: THandle;
begin
Printer.PrinterIndex := -1; // select a printer
Printer.GetPrinter(Device, Driver, Port, hDeviceMode);
S:= Format('"%s" "%s" "%s"',[Device, Driver, Port]);
ShellExecute( handle, 'printto', PChar(documentname), Pchar(S), Nil,
SW_HIDE );
Peter Below (TeamB) 10011...@compuserve.com)
No replies in private e-mail, please, unless explicitly requested!