Display PDF File inside the Form using C#

In this tutorial, I will teach you how to create a program that will open and display a PDF File inside the form using C# language. So, now let's start this tutorial! 1. Let's start with creating a Windows Form Application for this tutorial by following the following steps in Microsoft Visual Studio 2010: Go to File, click New Project, and choose Windows Application. 2. Add one button to browse the PDF Files. Then right click anywhere on the toolbox and click "Choose Items". design Right click the project to add reference. design And then on the COM tab, choose Adobe PDF Reader. design Then click the adobe reader and put it inside the form. 3. Now, have this code below inside the button.
  1.         private void button1_Click(object sender, EventArgs e)
  2.         {
  3.  
  4.             // open the file dialog to locate pdf files
  5.             OpenFileDialog openFileDialog1 = new OpenFileDialog();
  6.             openFileDialog1.Filter = "PDF Files (*)|*.pdf";
  7.  
  8.             // after choosing the pdf file, it will display inside the form
  9.             if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  10.             {
  11.                 axAcroPDF1.src = openFileDialog1.FileName;
  12.             }
  13.         }
Output: output For more inquiries and need programmer for your thesis systems in any kind of programming languages, just contact my number below. Best Regards, Engr. Lyndon Bermoy IT Instructor/System Developer/Android Developer/Freelance Programmer If you have some queries, feel free to contact the number or e-mail below. Mobile: 09488225971 Landline: 826-9296 E-mail:[email protected] Add and Follow me on Facebook: https://www.facebook.com/donzzsky Visit and like my page on Facebook at: https://www.facebook.com/BermzISware

Add new comment