C# Exercises

Home AgriMetSoft About Contact

PDF Viewer Control in Winforms c#

	    
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace PDF_Viewer
{
  //NuGet\Install-Package Spire.PDFViewer -Version 7.10.3
  public partial class Form1 : Form
  {
    public Form1()
    {
      InitializeComponent();
    }

    private void Form1_Load(object sender, EventArgs e)
    {
      OpenFileDialog opf = new OpenFileDialog();
      opf.Filter = "Pdf File|*.pdf";
      if (opf.ShowDialog() == DialogResult.OK)
      {
        if (File.Exists(opf.FileName))
        {
          this.pdfViewer1.LoadFromFile(opf.FileName);
        }
      }
    }
  }
}
		
	 


Download the project of Visual Studio 2013 in DropBox Download


How to Add PDF Viewer in Winforms C# | Show PDF File in Form


List of Exercises