|
-
Jul 30th, 2008, 02:16 PM
#1
[2008] I need to print a PDF via code
I have to print out a PDF via code, and the code will assume adobe reader (or acrobat) is installed and configured properly to open PDF files.
I have it working, with the exception that it prints to the default printer always. I am looking for a way to do this, but have it prompt with a printer dialog.
I am pretty sure this can be accomplished by shelling the reader exe with some command line params, but I don't want to do that, because the users will have either reader OR the full acrobat installed, so I can't assume they will have reader, only that they will have one or the other.
If there is no known way to do this, I will try my second method, which is to get the exe associated with PDF documents, and launch that, passing the doc and the printer as params, and test that.
Any ideas?
This is the code that works, but prints to the default printer.
Code:
Dim PSI As New ProcessStartInfo("c:\document.pdf")
PSI.Verb = "print"
Process.Start(PSI)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|