EvoPdf Classic · PDF Viewer for Windows Forms

EVO PDF Viewer Control for Windows Forms and WPF

EVO PDF Viewer control for Windows Forms can be linked into any Windows Forms or WPF application to add PDF visualization and manipulation capabilities to your desktop application.

Classic v14.0 · Windows, .NET Framework 2.0+ and .NET 6–10 · Evaluate without registration — demo mode by default (watermarked) · Licensed with the HTML to PDF Converter license or EVO PDF Toolkit

  • Windows 10 / 11 / Server 2016–2025
  • .NET Framework 2.0 – 4.8.1
  • .NET 6 → 10, .NET Standard 2.0
  • Azure Cloud Services & Virtual Machines
  • Web, console and desktop applications
Features

What the PDF Viewer for Windows Forms component does

  • .NET user control and C# samples
  • Display PDF documents from files
  • Display PDF documents from streams
  • Navigate and print documents
  • Navigate to a PDF page programmatically
  • Set viewer zoom level programmatically
  • Set page layout to one or more columns
  • Display password protected PDF documents
  • Show or hide viewer toolbars
  • Show or hide viewer scroll bars
  • Show or hide viewer navigation panel
  • Disable PDF document printing or copying
  • Royalty free development libraries and samples
  • Support for .NET 4.0 framework and later
  • Documentation and C# samples for all the features
In detail

EVO PDF Viewer Control for Windows Forms and WPF — how it works

EVO PDF Viewer Control for Windows Forms and WPF can be linked into any Windows Forms application to add PDF visualization and manipulation capabilities to your application. With EVO PDF Viewer for Windows Forms and WPF you can display a PDF from a specified file, navigate the document, print the documents, control PDF security options to disable content copying or printing.

The integration is extremely easy. The free Adobe Reader is required on the machine where the control is used.

The code below was taken from the PDF Viewer for Windows Forms Demo demo application available for download in the product package. In this sample an instance of the PdfViewer class is used to display a PDF document in a Windows Forms application.

At a glance

Component
EvoPdf Classic · PDF Viewer for Windows Forms
Runs on
Windows · .NET Framework 2.0+ · .NET 6–10 (.NET Standard 2.0)
Version
Classic v14.0
License
HTML to PDF Converter license or EVO PDF Toolkit; evaluation without registration
Documentation →
Sample.csC#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;

// The PDF Viewer namespace
using PdfViewer4WinNet;

namespace PdfViewerWinNetDemo
{
    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();
        }

        private void MainForm_Load(object sender, EventArgs e)
        {
            LoadPageLayoutModes();
            LoadDocumentDisplayModes();
            LoadPageFitModes();
            LoadViewerPreferences();

            formTooltip.SetToolTip(btnOpenFile, "Open a file in viewer");
            formTooltip.SetToolTip(btnPrintDialog, "Opens the print dialog");

            string demoFilePath = System.IO.Path.Combine(Application.StartupPath, "evopdf.pdf");
            if (System.IO.File.Exists(demoFilePath))
            {
                // load PDF from file
                pdfViewerControl.LoadFile(demoFilePath);
                lblPageCount.Text = pdfViewerControl.PageCount > 0 ? 
                    String.Format("Page Count: {0}", pdfViewerControl.PageCount) : String.Empty;
            }
        }

        private void LoadPageLayoutModes()
        {
            string[] pageLayoutModes = Enum.GetNames(typeof(PageLayoutMode));
            ddlPageLayout.DataSource = pageLayoutModes;
            ddlPageLayout.SelectedItem = PageLayoutMode.NotSet.ToString();
        }

        private void LoadDocumentDisplayModes()
        {
            string[] documentDisplayModes = Enum.GetNames(typeof(DocumentDisplayMode));
            ddlDocumentDisplayMode.DataSource = documentDisplayModes;
            ddlDocumentDisplayMode.SelectedItem = DocumentDisplayMode.NotSet.ToString();
        }

        private void LoadPageFitModes()
        {
            string[] pageFitModes = Enum.GetNames(typeof(PageFitMode));
            ddlPageFitMode.DataSource = pageFitModes;
            ddlPageFitMode.SelectedItem = PageFitMode.NotSet.ToString();
        }

        private void LoadViewerPreferences()
        {
            cbShowNavigationPanel.Checked = pdfViewerControl.ShowNavigationPanel;
        }

        private void btnOpenFile_Click(object sender, EventArgs e)
        {
            OpenFileDialog fd = new OpenFileDialog();
            if (fd.ShowDialog() == DialogResult.OK)
            {
                using (FileStream pdfFileStream = new FileStream(fd.FileName, FileMode.Open, FileAccess.Read))
                {
                    // load PDF from stream
                    pdfViewerControl.LoadStream(pdfFileStream);
                    lblPageCount.Text = pdfViewerControl.PageCount > 0 ? 
                        String.Format("Page Count: {0}", pdfViewerControl.PageCount) : String.Empty;
                }
            }
        }

        private void btnPrintDialog_Click(object sender, EventArgs e)
        {
            pdfViewerControl.PrintWithDialog();
        }

        private void btnZoom_Click(object sender, EventArgs e)
        {
            SetZoomDialog zd = new SetZoomDialog();
            zd.Percentage = 100;
            if (zd.ShowDialog() == DialogResult.OK)
            {
                pdfViewerControl.SetZoom(zd.Percentage);
            }
        }

        private void cbShowToolbar_CheckedChanged(object sender, EventArgs e)
        {
            pdfViewerControl.SetShowToolbar(cbShowToolbar.Checked);
        }

        private void btnSetPageNumber_Click(object sender, EventArgs e)
        {
            SetPageNumberDialog pnd = new SetPageNumberDialog(pdfViewerControl.PageCount);
            pnd.PageNumber = 1;
            if (pnd.ShowDialog() == DialogResult.OK)
            {
                pdfViewerControl.SetCurrentPage(pnd.PageNumber);
            }
        }

        private void btnFirstPage_Click(object sender, EventArgs e)
        {
            pdfViewerControl.GoToFirstPage();
        }

        private void btnLastPage_Click(object sender, EventArgs e)
        {
            pdfViewerControl.GoToLastPage();
        }

        private void btnPreviousPage_Click(object sender, EventArgs e)
        {
            pdfViewerControl.GoToPreviousPage();
        }

        private void btnNextPage_Click(object sender, EventArgs e)
        {
            pdfViewerControl.GoToNextPage();
        }

        private void btnBack_Click(object sender, EventArgs e)
        {
            pdfViewerControl.GoBackwardStack();
        }

        private void btnForward_Click(object sender, EventArgs e)
        {
            pdfViewerControl.GoForwardStack();
        }

        private void ddlPageLayout_SelectedIndexChanged(object sender, EventArgs e)
        {
            pdfViewerControl.PageLayoutMode = (PageLayoutMode)Enum.Parse(typeof(PageLayoutMode), 
                ddlPageLayout.SelectedItem.ToString());
            if (pdfViewerControl.PageLayoutMode == PageLayoutMode.NotSet)
                pdfViewerControl.ReloadPdfDocument();
        }

        private void ddlPageFitMode_SelectedIndexChanged(object sender, EventArgs e)
        {
            pdfViewerControl.PageFitMode = (PageFitMode)Enum.Parse(typeof(PageFitMode), 
                ddlPageFitMode.SelectedItem.ToString());
            if (pdfViewerControl.PageFitMode == PageFitMode.NotSet)
                pdfViewerControl.ReloadPdfDocument();
        }

        private void ddlDocumentDisplayMode_SelectedIndexChanged(object sender, EventArgs e)
        {
            pdfViewerControl.DocumentDisplayMode = (DocumentDisplayMode)Enum.Parse(typeof(DocumentDisplayMode), 
                ddlDocumentDisplayMode.SelectedItem.ToString());
            if (pdfViewerControl.DocumentDisplayMode == DocumentDisplayMode.NotSet)
                pdfViewerControl.ReloadPdfDocument();
        }

        private void cbShowScrollbar_CheckedChanged(object sender, EventArgs e)
        {
            pdfViewerControl.ShowScrollbars = cbShowScrollbar.Checked;
        }

        private void cbShowNavigationPanel_MouseClick(object sender, MouseEventArgs e)
        {
            cbShowNavigationPanel.Checked = !cbShowNavigationPanel.Checked;
            MessageBox.Show("The left navigation panel visibility can be changed by ShowNavigationPanel 
                property only before loading the control. For example you can set this property in the Properties 
                windows from Visual Studio before running the demo application.");
        }

        private void btnApplySecurityOptions_Click(object sender, EventArgs e)
        {
            pdfViewerControl.PdfSecurityOptions.CanPrint = cbAllowPrint.Checked;
            pdfViewerControl.PdfSecurityOptions.CanCopyContent = cbAllowContentCopy.Checked;
            pdfViewerControl.PdfSecurityOptions.CanFillFormFields = cbAllowFormFilling.Checked;
            pdfViewerControl.PdfSecurityOptions.CanEditContent = cbAllowContentEdit.Checked;
            pdfViewerControl.PdfSecurityOptions.CanEditAnnotations = cbAllowEditAnnotation.Checked;
            pdfViewerControl.PdfSecurityOptions.CanAssembleDocument = cbAllowAssemble.Checked;
            pdfViewerControl.PdfSecurityOptions.UserPassword = textBoxUserPassword.Text.Trim();

            pdfViewerControl.ReloadPdfDocument();
        }

        private void cbAllowFormFilling_CheckedChanged(object sender, EventArgs e)
        {
            if (!cbAllowFormFilling.Checked)
            {
                cbAllowContentEdit.Checked = false;
                cbAllowEditAnnotation.Checked = false;
            }
        }
    }
}
Licensing

Perpetual licenses, updates and support included for a year

The HTML to PDF Converter license (450 USD Deployment / 1200 USD Company) covers the Classic and the Next converter; the EVO PDF Toolkit (650 / 1400 USD) covers every component on this site, Classic tools included. The Company License includes redistribution.