Printing PDF document using Visual Basic.NET

  • Thread starter Thread starter BobRoyAce
  • Start date Start date
B

BobRoyAce

I am using Visual Studio .NET 2005, using Visual Basic, to create a
Windows Forms application. I want to add the ability to the application
to print a PDF file that already exists when the user clicks on a
button. Any ideas on how I can accomplish this?

Also, does anyone have experience with any of the .NET assembly
products out there that allow for merging PDF documents together?
Ideally, I'd like to find one product that facilitates both merging and
printing, but primary purpose of this post is to see if anyone knows of
a way to print PDFs from my app.
 
Thanks for the pointer...that worked! I created a Sub that includes the
following code:

Dim psi As New ProcessStartInfo()
With psi
.Verb = "print"
.WindowStyle = ProcessWindowStyle.Hidden
.CreateNoWindow = True
.FileName = sFileName
.UseShellExecute = True
End With
Process.Start(psi)

Now, the only thing keeping this from being a perfect solution for me
is that it ends up opening up an instance of Acrobat reader (NOTE: I am
printing PDFs) which is then minimized in the taskbar. This is not a
terrible thing, mind you, but I would prefer if it weren't there. Is
there a way to eliminate this? I tried using the CreateNoWindow
parameter (see above), but that didn't do it.
 
Back
Top