Posted by webmaster Guido on April 26, 2004
: What i want to do is to transform a .doc or .xls into .pdf
Directly printing a file with its "parent" application is easy, such as printing a .doc with MS-Word or an .xls with Excel:
Note that this only works if the user has the parent application installed. For more examples of ShellExecute, see the article "Running an external application" in DelphiLand's section "Code snips" at www.festra.com\eng\mtut01.htm
The application opens briefly, it prints the document, and it automatically closes. But... the file is printed with the *default* printer, and that's not what you want. There might some solutions:
1. Set the default printer to the pdf-printer; print the file; next set the default printer back to its previous setting. I'll try to find out if this is not too complicated.
2. A better solution: send the document directly to the pdf-printer-application. But then this application must accept a command line parameter. I'll try to find out if that is possible.
Can you please let me know the exact name of your pdf-printer? Is it "Gosth", as you wrote? And where can it be found?