• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 393
  • Last Modified:

What Would Be Best C# Windows Form Control To Display Rendering of PDF file

I am attempting to create a new application that will read in the contents of an Adobe PDF file that will be stored in a specified location on my local machine and eventually a server. I am wondering what C# control would be the best to display a rendering of the Adobe PDF image when the user clicks on search terms and pulls back a result from the directory in which all of the *.pdf files are stored. (I have attached an image of a generic form to pull back the results and just to display the results in the right hand RichTextBox, or where the control is.) Could someone give me some suggestions as to what would be a good C# Windows Control that would display an Adobe PDF file within the attached image of the Windows form that is part of my project?

Thank you to any suggestions in advance. Archived Email Viewer Sample
0
thenthorn1010
Asked:
thenthorn1010
2 Solutions
 
Carlos VillegasFull Stack .NET DeveloperCommented:
Hello, I'm not sure if this is the best way, but if the Adobe Reader is installed in your enviroment, a simple way is to use a System.Windows.Forms.WebBrowser control (you can find it on your control toolbox):
How to display the pdf?
webBrowser1.Navigate(@"C:\Temp\MyFile.pdf");

Open in new window

0
 
nishant joshiTechnology Development ConsultantCommented:

public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            webBrowser1.Navigate("jquery_documentation.pdf");
            webBrowser1.Hide();
        }

        private void webBrowser1_Navigating(object sender, WebBrowserNavigatingEventArgs e)
        {
            pictureBox1.Show();
  
        }

        private void webBrowser1_Navigated(object sender, WebBrowserNavigatedEventArgs e)
        {
            pictureBox1.Hide();
            webBrowser1.Show();
        }
    }

Open in new window

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now