Windows Forms and WPF controls
Drag the PdfViewer control onto a form, or use the WPF control in XAML with its Source property. Both can run in the same application.
ExpertPdf PDF Viewer adds PDF viewing to Windows Forms, WPF, ASP.NET Web Forms and ASP.NET Core applications. Display PDF documents from a file, a URL or memory, page through them, search their text and print them, with a light or dark theme and the toolbar buttons you choose.
Version 10 is built on PDF.js: no Adobe Reader and no plug-in. Two controls, licensed separately: the PDF Viewer for Windows Forms and WPF, and the PDF Viewer for ASP.NET.
PDF Viewer for ASP.NET: Documentation · Online demo · NuGet · Download .zip (v10.0.0)
PDF Viewer for WinForms and WPF: Documentation · NuGet · Download .zip (v10.0.0)
Display PDF documents in a desktop application or in a web page. Each control is a separate product with its own license.
The PDF Viewer for Windows Forms and WPF, from $250 for a developer license.
Drag the PdfViewer control onto a form, or use the WPF control in XAML with its Source property. Both can run in the same application.
Load a document with LoadFile, LoadStream or LoadBytes, for example a PDF made in memory by the HTML to PDF Converter, and close it with CloseDocument.
Go to any page from code, and search the text with Find, FindNext and FindPrevious; SearchCompleted reports the matches.
Print with the print dialog, or silently to a chosen printer and page range with PrintAsync.
Open password-protected documents: supply the password in the PasswordRequired event, or let the viewer ask the user.
Light, dark or system theme with ViewerTheme, and show or hide single buttons: open, sidebar, find, page navigation, zoom, print, download, presentation mode, document properties.
The Microsoft Edge WebView2 Runtime comes with Windows 10 and 11. Elsewhere the control can install it (InstallWebView2RuntimeIfMissing), or use a fixed version you ship. 32-bit, 64-bit and ARM64 processes.
DocumentLoaded, CurrentPageChanged and LoadError keep your application in step with the viewer.
The PDF Viewer for ASP.NET, from $250 for a developer license.
Add <expertpdf-viewer> to a Razor page or view, with app.UseExpertPdfViewer() in Program.cs.
Drag the PdfViewer control onto a Web Form. It serves its own files: nothing to add to web.config.
Show a document from an address with PdfSourceURL (src), or from memory with PdfSourceBytes (source-bytes), with no temporary file.
The documents are shown by a bundled PDF.js viewer: no Adobe Reader and no plug-in on the user's computer.
Allow or block printing and downloading, choose the theme and the toolbar buttons.
ExpertPdfViewer.get(id) controls the viewer from the page: go to a page, zoom, search, highlight, print, and events such as loaded and pagechange.
The controls, samples and API documentation, for .NET Framework 4.6.2 and .NET 8 or later.
Windows Forms, WPF, ASP.NET Web Forms and ASP.NET Core samples, for .NET Framework and .NET 10.
Royalty free development libraries and samples.
Version 9 code keeps building. Documents now load asynchronously: wait for DocumentLoaded before working with a document.
Set the LicenseKey property with the key you receive after the purchase. Version 10 needs a version 10 key.
Load a PDF file in the Windows Forms or WPF control, or show one in a Razor page or a Web Form, from a URL or from bytes.
using PdfViewer4WinNet; // pdfViewer was dropped on the form from the toolbox private void MainForm_Load(object sender, EventArgs e) { pdfViewer.LicenseKey = "your license key"; pdfViewer.DocumentLoaded += (s, a) => Text = pdfViewer.PageCount + " pages"; pdfViewer.LoadFile(@"C:\Docs\report.pdf"); } private void btnFind_Click(object sender, EventArgs e) { pdfViewer.Find(txtSearch.Text, false, true); } private void btnPrint_Click(object sender, EventArgs e) { pdfViewer.PrintWithDialog(); }
Imports PdfViewer4WinNet ' pdfViewer was dropped on the form from the toolbox Private Sub MainForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load pdfViewer.LicenseKey = "your license key" AddHandler pdfViewer.DocumentLoaded, Sub(s, a) Text = pdfViewer.PageCount & " pages" pdfViewer.LoadFile("C:\Docs\report.pdf") End Sub Private Sub btnFind_Click(sender As Object, e As EventArgs) Handles btnFind.Click pdfViewer.Find(txtSearch.Text, False, True) End Sub Private Sub btnPrint_Click(sender As Object, e As EventArgs) Handles btnPrint.Click pdfViewer.PrintWithDialog() End Sub
Windows Forms and WPF: dotnet add package ExpertPdf.PdfViewer.WinForms.ASP.NET: dotnet add package ExpertPdf.PdfViewer.AspNet. Or reference PdfViewerWinNet.dll or PdfViewerAspNet.dll from the download. The viewer includes PDF.js, licensed under the Apache License 2.0.
Common questions about hosting, requirements and licensing.
<expertpdf-viewer> tag helper.Find, FindNext and FindPrevious search from code and SearchCompleted reports the matches. For a protected document, the PasswordRequired event lets your code supply the password; without a handler the viewer asks the user.ViewerTheme, and show or hide single toolbar buttons such as print, download, open and find. In ASP.NET, AllowPrint and AllowDownload control printing and downloading.DocumentLoaded event. In ASP.NET, the PdfSourceBytes handler in web.config is no longer needed.Download the free trial of the Windows Forms and WPF or the ASP.NET control, with C# and VB.NET samples. When you are ready, license the control you need on the pricing page.