C# PDF Viewers
This article will explore various methods of viewing PDFs in a .NET application. This article will explore various methods of viewing PDFs. 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
Start using IronPDF in your project today with a free trial.
How to View PDF in .NET?
- Explore IronPDF Package on NuGet for .NET PDF Viewing
- Use HTML
iframe
tag in ASP.NET & MVC PDF viewer - Utilize WPF C# PDF Viewer using
WebBrowser
control - View PDF directly in Windows Forms PDF Viewer
- Utilize
System.Diagnostics.Process.Start
in Default System PDF Viewer
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 will generally open the PDF in the default web browser, which supports viewing PDF content, 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);
IronPDF provides a PDF viewer for MAUI projects. For more information, please visit the following link: "Viewing PDFs in MAUI for C# .NET."