Reputation: 8988
I want to show/preview local pdf files in a winforms application ()
Currently I am using Webbrowser control and tried the Navigate(uri)
method but it is launching the PDF file with third party interface
Below are few highly voted answers related to the same context but unfortunately it didn't help me as the solution involves dependency of showing pdf using already installed pdf viewer in the system (Acrobat/Nirto/IE etc)
Please let me know if its possible to show the pdf without using third party packages.
Viewing PDF in Windows forms using C#
Displaying a pdf file from Winform
Upvotes: 4
Views: 10194
Reputation: 2544
First Method :
Use the Adobe PDF reader COM Component
Second Method :
add a WebBrowser Control into your Form and open the file by using the Navigate Method
AddedwebBrowserControl.Navigate(@"c:\IntroductiontoSqlServer.pdf");
EDIT : If you dont have adobe reader installed on your machine , then the First Method will Not work for you
Upvotes: 4