Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / August 2006

Tip: Looking for answers? Try searching our database.

Printing PDF document using Visual Basic.NET

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
BobRoyAce - 25 Aug 2006 04:10 GMT
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.
Herfried K. Wagner [MVP] - 25 Aug 2006 11:49 GMT
"BobRoyAce" <broy@omegasoftwareinc.com> schrieb:
>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?

Printing files of various types without user interaction
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=printinganyfile&lang=en>

Signature

M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://dotnet.mvps.org/dotnet/faqs/>

BobRoyAce - 26 Aug 2006 07:41 GMT
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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.