C# PDF Viewers

This article will explore various methods of viewing PDFs in a .NET application. Viewing PDFs within applications is a common requirement that can be easily addressed using the PDF Library for .NET.

IronPDF provides a PDF viewer for MAUI projects. For more information, please visit the following link: "Viewing PDFs in MAUI for C# .NET."

Get started with IronPDF


ASP.NET & MVC PDF viewer

For web applications, PDFs can be viewed in a browser window or iframe. Alternatively, you can utilize the impressive pdf.js library from Mozilla, which provides a comprehensive PDF viewer written entirely in JavaScript.


WPF C# PDF Viewer

For viewing PDF documents directly in WPF, you can use the native WebBrowser control.


Windows Forms PDF Viewer

For viewing PDF documents directly in Windows Forms (WinForms) applications, the WebBrowser control is also a good choice.


Viewing a PDF in the Default System PDF Viewer

To open a PDF from any application in an external window, we may use a trick involving System.Diagnostics.Process.Start. This method will open the PDF in the default application for PDF viewing, such as a web browser or Adobe Acrobat, if installed.

:path=/static-assets/pdf/content-code-examples/how-to/net-pdf-viewer-default-pdf-viewer.cs
using IronPdf;

// Render any HTML fragment or document to HTML
ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Hello IronPdf</h1>");

var outputPath = "ChromePdfRenderer.pdf";

// Export PDF document
pdf.SaveAs(outputPath);

// This neat trick opens our PDF file so we can see the result in our default PDF viewer
System.Diagnostics.Process.Start(outputPath);
Imports IronPdf

' Render any HTML fragment or document to HTML
Private renderer As New ChromePdfRenderer()
Private pdf As PdfDocument = renderer.RenderHtmlAsPdf("<h1>Hello IronPdf</h1>")

Private outputPath = "ChromePdfRenderer.pdf"

' Export PDF document
pdf.SaveAs(outputPath)

' This neat trick opens our PDF file so we can see the result in our default PDF viewer
System.Diagnostics.Process.Start(outputPath)
$vbLabelText   $csharpLabel

This code snippet demonstrates how to use System.Diagnostics.Process.Start to open a PDF file with the default PDF viewer on the system. Ensure that the specified file path points to a valid PDF file on your system.

IronPDF provides a PDF viewer for MAUI projects. For more information, please visit the following link: "Viewing PDFs in MAUI for C# .NET."

Chaknith Bin
Software Engineer
Chaknith works on IronXL and IronBarcode. He has deep expertise in C# and .NET, helping improve the software and support customers. His insights from user interactions contribute to better products, documentation, and overall experience.