Re: HOW Do I print a PDF File through ShellExecute

Posted by Michel Baudoin on July 15, 2004

In Reply to: Re: HOW Do I print a PDF File through ShellExecute posted by webmaster Guido on June 08, 2004

: : Hey guys, I've been given a million different examples of how shell execute should be run.

: : Can someone tell me what the most simple way would be to PRINT a PDF file from ShellExecute?

: In your Delphi application, use the same code as for printing any other "registered" document type. Registered: if the extension is known by Windows, so that it can send it to its native application. Example:

: ShellExecute(Handle, 'print', PChar('c:\test\test.pdf'), nil, nil, SW_SHOW)

: This will work if there is an application on the system that can print .PDF files, such as Acrobat Reader.

It won't work with version 6.0 of .PDF if you try to print more than one .PDF file because Acrobat reader does not close after the first one.

I have tried it in a VB pgm. I'm still trying to find a solution....

Michel


[ DelphiLand FAQ ]