Create Sample PDF Viewer UI Application - C#
PDF Viewer SDK sample in C# demonstrating ‘Create Sample PDF Viewer UI Application’
Form1.cs
using System;
using System.Windows.Forms;
namespace Sample_UI_Application
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void tsbOpen_Click(object sender, EventArgs e)
{
using (OpenFileDialog openFileDialog = new OpenFileDialog())
{
openFileDialog.Title = @"Open PDF Document";
openFileDialog.Filter = @"PDF Files (*.pdf)|*.pdf|All Files|*.*";
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
this.Text = openFileDialog.FileName;
Cursor = Cursors.WaitCursor;
try
{
pdfViewerControl1.InputFile = openFileDialog.FileName;
}
catch (Exception exception)
{
MessageBox.Show(exception.Message);
}
finally
{
Cursor = Cursors.Default;
}
}
}
}
}
}
Form1.Designer.cs
��n a m e s p a c e S a m p l e _ U I _ A p p l i c a t i o n
{
p a r t i a l c l a s s F o r m 1
{
/ / / <