Is there any way to view PDF files in a Winforms tool? I've seen solutions such as converting the pdf file into images and showing them in an picture box. However, I am asking whether i can view the file as PDF. Is there any tool from adobe or from Microsoft that supports this?
If you've got a PDF file in a project you can right-click in the solution explorer and choose "Open with..". Now you can choose which editor you want to use. If Acrobat isn't already listed you can add it and after that click the button "Set as default".
you can use System.Diagnostics.Process.Start as well as WIN32 ShellExecute function by means of interop, for opening PDF files using the default viewer:
System.Diagnostics.Process.Start("SOMEAPP.EXE","Path/SomeFile.Ext"); [System.Runtime.InteropServices.DllImport("shell32. dll")] private static extern long ShellExecute(Int32 hWnd, string lpOperation, string lpFile, string lpParameters, string lpDirectory, long nShowCmd);
Another approach is to place a WebBrowser Control into your Form and then use the Navigate method for opening the PDF file:
ThewebBrowserControl.Navigate(@"c:\the_file.pdf");
i think the easiest way is to use the Adobe PDF reader COM Component
i hope this helps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With