Display PDF File inside the Form using C#
Submitted by donbermoy on Monday, November 9, 2015 - 11:17.
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".
Right click the project to add reference.
And then on the COM tab, choose Adobe PDF Reader.
Then click the adobe reader and put it inside the form.
3. Now, have this code below inside the button.
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
- private void button1_Click(object sender, EventArgs e)
- {
- // open the file dialog to locate pdf files
- openFileDialog1.Filter = "PDF Files (*)|*.pdf";
- // after choosing the pdf file, it will display inside the form
- if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- axAcroPDF1.src = openFileDialog1.FileName;
- }
- }
Add new comment
- 209 views