# How to View PDFs in .NET with IronPDF C#
IronPDF displays PDFs in .NET applications through the `IronPdf.Viewer.Maui` control for MAUI, by rasterizing pages to images with `RasterizeToImageFiles` for any UI framework, and through host controls such as WebView2 in WPF and Windows Forms. The right choice depends on what kind of app you are building and how much viewer chrome you need.
"Viewing" means different things across these paths. The MAUI viewer is a full interactive component with a toolbar. The rasterize path turns each page into an image you can show in any control. The WebView2 and default-viewer routes hand the file to a browser engine or the user's installed PDF reader. This article shows each one and is honest about what it does and does not give you.
*as-heading:2(Quickstart: View a PDF in MAUI with IronPDF)*
Add the `IronPdf.Viewer.Maui` NuGet package, call `ConfigureIronPdfView()` in `MauiProgram.cs`, then bind a PDF to an `IronPdfView`. The single line below loads a file into the viewer control.
```cs
:title=Load a PDF into the MAUI viewer in one line!
new IronPdf.Viewer.Maui.IronPdfView { Source = IronPdf.Viewer.Maui.IronPdfViewSource.FromFile("document.pdf") };
```
Install the package first with `Install-Package IronPdf.Viewer.Maui`, and add your IronPDF license key in `ConfigureIronPdfView` to remove the trial banner. The [MAUI viewer tutorial](/tutorials/pdf-viewing/) walks through the full project setup.
<div class="hsg-featured-snippet">
<h3>Minimal Workflow (5 steps)</h3>
<ol>
<li><a class="js-modal-open" data-modal-id="trial-license-after-download" href="https://www.nuget.org/packages/IronPdf/">Install IronPDF from NuGet for .NET PDF rendering</a></li>
<li>Pick a viewing path: MAUI viewer, rasterize-to-image, WebView2, or the default system viewer</li>
<li>Embed a PDF in ASP.NET with an HTML <code>iframe</code></li>
<li>Render PDF pages to images for WPF, WinForms, or Blazor display</li>
<li>Open a PDF in the user's installed reader with <code>System.Diagnostics.Process.Start</code></li>
</ol>
</div>
<br class="clear" />
## How Do I View PDFs in ASP.NET & MVC?
Serve the PDF from a controller action and embed it with an HTML `iframe`. The browser's built-in PDF viewer handles rendering, so the document appears inline while your page layout stays intact. When the PDF is generated on the fly, IronPDF's [HTML to PDF conversion](/how-to/html-string-to-pdf/) produces the file the action returns.
```csharp
// Controller action to serve PDF
public ActionResult ViewPdf()
{
var pdfPath = Server.MapPath("~/Content/sample.pdf");
return File(pdfPath, "application/pdf");
}
// In your Razor view
<iframe src="@Url.Action("ViewPdf")" width="100%" height="600px"></iframe>
```
If you need text selection, zoom, and page navigation that you control rather than the browser default, render the PDF pages to images (shown below) and display them, or wire up a JavaScript viewer of your choice.
<hr class="separator" />
## How Do I Display PDF Pages as Images in WPF, WinForms, or Blazor?
Call `RasterizeToImageFiles` to turn each PDF page into a PNG, then show those images in any control: a WPF `Image`, a WinForms `PictureBox`, or an `<img>` in a Blazor component. This is the IronPDF-native viewing path. It works the same on every UI framework and on every operating system IronPDF supports, because it produces plain image files rather than depending on a host browser control.
### Input
<iframe loading="lazy" src="/static-assets/pdf/how-to/net-pdf-viewer/sample-report.pdf" width="100%" height="500px"></iframe>
```csharp
using IronPdf;
// Load the PDF you want to display.
PdfDocument pdf = PdfDocument.FromFile("sample-report.pdf");
// Render every page to a PNG. The asterisk in the path is replaced with the page number,
// producing viewer-page-1.png, viewer-page-2.png, and so on. The last argument (100) is the DPI.
pdf.RasterizeToImageFiles("viewer-page-*.png", IronPdf.Imaging.ImageType.Png, 100);
// To show a page inside a GUI control without writing to disk, get in-memory bitmaps instead.
// ToBitmap returns one AnyBitmap per page; bind bitmaps[0] to a WPF Image or a WinForms PictureBox.
var bitmaps = pdf.ToBitmap();
bitmaps[0].SaveAs("viewer-firstpage.png");
```
### Output
<img src="/static-assets/pdf/how-to/net-pdf-viewer/rasterized-page-1.png" alt="First page of the sample report PDF rasterized to a PNG image for display in a .NET UI control" width="100%" class="img-responsive add-shadow" />
For an in-memory option, `ToBitmap` returns one image per page that you can bind to a control without touching the disk. Adjust the DPI argument to trade file size against sharpness, the same control you have over IronPDF's [rendering options](/how-to/rendering-options/) when producing the document.
<hr class="separator" />
## How Do I View PDFs in WPF Applications?
Host the PDF in a WebView2 control, which uses the Chromium engine from Microsoft Edge and ships with its own PDF viewer (toolbar, zoom, and print included). Save the document to disk, then navigate the control to the file URI. WebView2 is the current replacement for the older `WebBrowser` control, which relied on the deprecated Internet Explorer engine.
```csharp
// WPF: display a PDF using the WebView2 control (Microsoft Edge / Chromium).
// Install the NuGet package Microsoft.Web.WebView2 and add a <wv2:WebView2 x:Name="pdfWebView" />
// element to your XAML (xmlns:wv2="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf").
// WebView2 renders PDFs with the same built-in viewer as the Edge browser (toolbar, zoom, print).
using System;
using System.IO;
// Save the IronPDF-generated document to disk first, then point WebView2 at it.
var pdf = new IronPdf.ChromePdfRenderer().RenderHtmlAsPdf("<h1>Hello IronPDF</h1>");
string pdfPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "document.pdf");
pdf.SaveAs(pdfPath);
// pdfWebView is the WebView2 control declared in your XAML.
// EnsureCoreWebView2Async must complete before navigating.
await pdfWebView.EnsureCoreWebView2Async();
pdfWebView.CoreWebView2.Navigate(new Uri(pdfPath).AbsoluteUri);
// Legacy alternative: the older System.Windows.Controls.WebBrowser control still works on
// Windows machines that have a PDF handler installed, but it relies on the deprecated Internet
// Explorer engine and is not recommended for new applications. Prefer WebView2 above.
```
[[w:(WebView2 requires the Microsoft Edge WebView2 Runtime on the target machine. It is preinstalled on current Windows 11 builds; for older systems, ship the Evergreen bootstrapper with your installer.)]]
<hr class="separator" />
## How Do I View PDFs in Windows Forms?
Drop a WebView2 control onto your form and point it at the saved PDF, exactly as in WPF. The control initializes asynchronously, so await `EnsureCoreWebView2Async` before calling `Navigate`. This gives WinForms apps the same Chromium-based viewer without bundling a third-party component.
```csharp
// Windows Forms: display a PDF using the WebView2 control (Microsoft Edge / Chromium).
// Install the NuGet package Microsoft.Web.WebView2, then drag a WebView2 control onto your form
// (or add it in code) and name it pdfWebView.
using System;
using System.IO;
// Generate or load the PDF with IronPDF, then save it so WebView2 can open the file.
var pdf = new IronPdf.ChromePdfRenderer().RenderHtmlAsPdf("<h1>Hello IronPDF</h1>");
string pdfPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "document.pdf");
pdf.SaveAs(pdfPath);
// pdfWebView is the WebView2 control on your form.
// Initialize the runtime, then navigate to the local file URI.
await pdfWebView.EnsureCoreWebView2Async();
pdfWebView.CoreWebView2.Navigate(new Uri(pdfPath).AbsoluteUri);
// Legacy alternative: the System.Windows.Forms.WebBrowser control can host a PDF when a system
// PDF handler is registered, but it uses the deprecated Internet Explorer engine. Use WebView2
// for new projects so the viewer works consistently across modern Windows installs.
```
If you would rather not host a browser control at all, the image-based approach from the section above drops straight into a `PictureBox` and avoids the WebView2 runtime dependency entirely.
<hr class="separator" />
## How Do I View PDFs in the Default System PDF Viewer?
Pass the file path to `System.Diagnostics.Process.Start` to open the PDF in whatever reader the user has set as default, such as a browser or Adobe Acrobat. This hands rendering to an external application rather than embedding it, which suits utilities and batch tools that only need to show the finished file.
```csharp
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);
```
In production, wrap the call so a missing PDF handler does not crash the app:
```csharp
try
{
var psi = new System.Diagnostics.ProcessStartInfo
{
FileName = outputPath,
UseShellExecute = true
};
System.Diagnostics.Process.Start(psi);
}
catch (Exception ex)
{
// Handle the case where no PDF viewer is installed
MessageBox.Show($"Unable to open PDF: {ex.Message}");
}
```
## Conclusion
Each viewing path here trades interactivity for portability: the MAUI viewer gives a full toolbar, rasterizing to images works in any UI on any platform, WebView2 reuses the Edge engine, and `Process.Start` defers to the user's reader. Pick the one that matches your app rather than forcing a single answer.
Since most viewing starts with a document you generated, pair these techniques with the full [MAUI viewer tutorial](/tutorials/pdf-viewing/) when you need an interactive toolbar component.
IronPDF displays PDFs in .NET applications through the IronPdf.Viewer.Maui control for MAUI, by rasterizing pages to images with RasterizeToImageFiles for any UI framework, and through host controls such as WebView2 in WPF and Windows Forms. The right choice depends on what kind of app you are building and how much viewer chrome you need.
"Viewing" means different things across these paths. The MAUI viewer is a full interactive component with a toolbar. The rasterize path turns each page into an image you can show in any control. The WebView2 and default-viewer routes hand the file to a browser engine or the user's installed PDF reader. This article shows each one and is honest about what it does and does not give you.
Quickstart: View a PDF in MAUI with IronPDF
Add the IronPdf.Viewer.Maui NuGet package, call ConfigureIronPdfView() in MauiProgram.cs, then bind a PDF to an IronPdfView. The single line below loads a file into the viewer control.
new IronPdf.Viewer.Maui.IronPdfView { Source = IronPdf.Viewer.Maui.IronPdfViewSource.FromFile("document.pdf") };
C#
3Deploy to test on your live environment
Start using IronPDF in your project today with a free trial
Install the package first with Install-Package IronPdf.Viewer.Maui, and add your IronPDF license key in ConfigureIronPdfView to remove the trial banner. The MAUI viewer tutorial walks through the full project setup.
Pick a viewing path: MAUI viewer, rasterize-to-image, WebView2, or the default system viewer
Embed a PDF in ASP.NET with an HTML iframe
Render PDF pages to images for WPF, WinForms, or Blazor display
Open a PDF in the user's installed reader with System.Diagnostics.Process.Start
How Do I View PDFs in ASP.NET & MVC?
Serve the PDF from a controller action and embed it with an HTML iframe. The browser's built-in PDF viewer handles rendering, so the document appears inline while your page layout stays intact. When the PDF is generated on the fly, IronPDF's HTML to PDF conversion produces the file the action returns.
// Controller action to serve PDFpublic ActionResultViewPdf(){ var pdfPath = Server.MapPath("~/Content/sample.pdf"); returnFile(pdfPath, "application/pdf");}// In your Razor view<iframe src="@Url.Action("ViewPdf")" width="100%" height="600px"></iframe>
// Controller action to serve PDF
public ActionResult ViewPdf()
{
var pdfPath = Server.MapPath("~/Content/sample.pdf");
return File(pdfPath, "application/pdf");
}
// In your Razor view
<iframe src="@Url.Action("ViewPdf")" width="100%" height="600px"></iframe>
ImportsSystem.Web.Mvc' Controller action to serve PDFPublic Function ViewPdf() AsActionResult Dim pdfPath = Server.MapPath("~/Content/sample.pdf") ReturnFile(pdfPath, "application/pdf")End Function' In your Razor view<iframe src="@Url.Action("ViewPdf")" width="100%" height="600px"></iframe>
Imports System.Web.Mvc
' Controller action to serve PDF
Public Function ViewPdf() As ActionResult
Dim pdfPath = Server.MapPath("~/Content/sample.pdf")
Return File(pdfPath, "application/pdf")
End Function
' In your Razor view
<iframe src="@Url.Action("ViewPdf")" width="100%" height="600px"></iframe>
If you need text selection, zoom, and page navigation that you control rather than the browser default, render the PDF pages to images (shown below) and display them, or wire up a JavaScript viewer of your choice.
How Do I Display PDF Pages as Images in WPF, WinForms, or Blazor?
Call RasterizeToImageFiles to turn each PDF page into a PNG, then show those images in any control: a WPF Image, a WinForms PictureBox, or an <img> in a Blazor component. This is the IronPDF-native viewing path. It works the same on every UI framework and on every operating system IronPDF supports, because it produces plain image files rather than depending on a host browser control.
Input
using IronPdf;// Load the PDF you want to display.PdfDocument pdf = PdfDocument.FromFile("sample-report.pdf");// Render every page to a PNG. The asterisk in the path is replaced with the page number,// producing viewer-page-1.png, viewer-page-2.png, and so on. The last argument (100) is the DPI.pdf.RasterizeToImageFiles("viewer-page-*.png", IronPdf.Imaging.ImageType.Png, 100);// To show a page inside a GUI control without writing to disk, get in-memory bitmaps instead.// ToBitmap returns one AnyBitmap per page; bind bitmaps[0] to a WPF Image or a WinForms PictureBox.var bitmaps = pdf.ToBitmap();bitmaps[0].SaveAs("viewer-firstpage.png");
using IronPdf;
// Load the PDF you want to display.
PdfDocument pdf = PdfDocument.FromFile("sample-report.pdf");
// Render every page to a PNG. The asterisk in the path is replaced with the page number,
// producing viewer-page-1.png, viewer-page-2.png, and so on. The last argument (100) is the DPI.
pdf.RasterizeToImageFiles("viewer-page-*.png", IronPdf.Imaging.ImageType.Png, 100);
// To show a page inside a GUI control without writing to disk, get in-memory bitmaps instead.
// ToBitmap returns one AnyBitmap per page; bind bitmaps[0] to a WPF Image or a WinForms PictureBox.
var bitmaps = pdf.ToBitmap();
bitmaps[0].SaveAs("viewer-firstpage.png");
C#
Output
For an in-memory option, ToBitmap returns one image per page that you can bind to a control without touching the disk. Adjust the DPI argument to trade file size against sharpness, the same control you have over IronPDF's rendering options when producing the document.
My favorite library of this kind is IronPDF. It allows for fast and efficient manipulation of PDF files. It also has many valuable features, like exporting to PDF/A format and digitally signing PDF documents.
IronOCR means we can save $40,000 annually from manual processing, while enhancing productivity and freeing up resources for high-impact tasks. I would highly recommend it.
The IronSuite play a crucial role in our operations. These are tools that increase efficiencies across the business including creating floor plans and improving inventory management.
Host the PDF in a WebView2 control, which uses the Chromium engine from Microsoft Edge and ships with its own PDF viewer (toolbar, zoom, and print included). Save the document to disk, then navigate the control to the file URI. WebView2 is the current replacement for the older WebBrowser control, which relied on the deprecated Internet Explorer engine.
// WPF: display a PDF using the WebView2 control (Microsoft Edge / Chromium).// Install the NuGet package Microsoft.Web.WebView2 and add a <wv2:WebView2 x:Name="pdfWebView" />// element to your XAML (xmlns:wv2="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf").// WebView2 renders PDFs with the same built-in viewer as the Edge browser (toolbar, zoom, print).using System;using System.IO;// Save the IronPDF-generated document to disk first, then point WebView2 at it.var pdf = new IronPdf.ChromePdfRenderer().RenderHtmlAsPdf("<h1>Hello IronPDF</h1>");string pdfPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "document.pdf");pdf.SaveAs(pdfPath);// pdfWebView is the WebView2 control declared in your XAML.// EnsureCoreWebView2Async must complete before navigating.await pdfWebView.EnsureCoreWebView2Async();pdfWebView.CoreWebView2.Navigate(new Uri(pdfPath).AbsoluteUri);// Legacy alternative: the older System.Windows.Controls.WebBrowser control still works on// Windows machines that have a PDF handler installed, but it relies on the deprecated Internet// Explorer engine and is not recommended for new applications. Prefer WebView2 above.
// WPF: display a PDF using the WebView2 control (Microsoft Edge / Chromium).
// Install the NuGet package Microsoft.Web.WebView2 and add a <wv2:WebView2 x:Name="pdfWebView" />
// element to your XAML (xmlns:wv2="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf").
// WebView2 renders PDFs with the same built-in viewer as the Edge browser (toolbar, zoom, print).
using System;
using System.IO;
// Save the IronPDF-generated document to disk first, then point WebView2 at it.
var pdf = new IronPdf.ChromePdfRenderer().RenderHtmlAsPdf("<h1>Hello IronPDF</h1>");
string pdfPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "document.pdf");
pdf.SaveAs(pdfPath);
// pdfWebView is the WebView2 control declared in your XAML.
// EnsureCoreWebView2Async must complete before navigating.
await pdfWebView.EnsureCoreWebView2Async();
pdfWebView.CoreWebView2.Navigate(new Uri(pdfPath).AbsoluteUri);
// Legacy alternative: the older System.Windows.Controls.WebBrowser control still works on
// Windows machines that have a PDF handler installed, but it relies on the deprecated Internet
// Explorer engine and is not recommended for new applications. Prefer WebView2 above.
C#
Warning: WebView2 requires the Microsoft Edge WebView2 Runtime on the target machine. It is preinstalled on current Windows 11 builds; for older systems, ship the Evergreen bootstrapper with your installer.
How Do I View PDFs in Windows Forms?
Drop a WebView2 control onto your form and point it at the saved PDF, exactly as in WPF. The control initializes asynchronously, so await EnsureCoreWebView2Async before calling Navigate. This gives WinForms apps the same Chromium-based viewer without bundling a third-party component.
// Windows Forms: display a PDF using the WebView2 control (Microsoft Edge / Chromium).// Install the NuGet package Microsoft.Web.WebView2, then drag a WebView2 control onto your form// (or add it in code) and name it pdfWebView.using System;using System.IO;// Generate or load the PDF with IronPDF, then save it so WebView2 can open the file.var pdf = new IronPdf.ChromePdfRenderer().RenderHtmlAsPdf("<h1>Hello IronPDF</h1>");string pdfPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "document.pdf");pdf.SaveAs(pdfPath);// pdfWebView is the WebView2 control on your form.// Initialize the runtime, then navigate to the local file URI.await pdfWebView.EnsureCoreWebView2Async();pdfWebView.CoreWebView2.Navigate(new Uri(pdfPath).AbsoluteUri);// Legacy alternative: the System.Windows.Forms.WebBrowser control can host a PDF when a system// PDF handler is registered, but it uses the deprecated Internet Explorer engine. Use WebView2// for new projects so the viewer works consistently across modern Windows installs.
// Windows Forms: display a PDF using the WebView2 control (Microsoft Edge / Chromium).
// Install the NuGet package Microsoft.Web.WebView2, then drag a WebView2 control onto your form
// (or add it in code) and name it pdfWebView.
using System;
using System.IO;
// Generate or load the PDF with IronPDF, then save it so WebView2 can open the file.
var pdf = new IronPdf.ChromePdfRenderer().RenderHtmlAsPdf("<h1>Hello IronPDF</h1>");
string pdfPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "document.pdf");
pdf.SaveAs(pdfPath);
// pdfWebView is the WebView2 control on your form.
// Initialize the runtime, then navigate to the local file URI.
await pdfWebView.EnsureCoreWebView2Async();
pdfWebView.CoreWebView2.Navigate(new Uri(pdfPath).AbsoluteUri);
// Legacy alternative: the System.Windows.Forms.WebBrowser control can host a PDF when a system
// PDF handler is registered, but it uses the deprecated Internet Explorer engine. Use WebView2
// for new projects so the viewer works consistently across modern Windows installs.
C#
If you would rather not host a browser control at all, the image-based approach from the section above drops straight into a PictureBox and avoids the WebView2 runtime dependency entirely.
How Do I View PDFs in the Default System PDF Viewer?
Pass the file path to System.Diagnostics.Process.Start to open the PDF in whatever reader the user has set as default, such as a browser or Adobe Acrobat. This hands rendering to an external application rather than embedding it, which suits utilities and batch tools that only need to show the finished file.
using IronPdf;// Render any HTML fragment or document to HTMLChromePdfRenderer renderer = new ChromePdfRenderer();PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Hello IronPdf</h1>");var outputPath = "ChromePdfRenderer.pdf";// Export PDF documentpdf.SaveAs(outputPath);// This neat trick opens our PDF file so we can see the result in our default PDF viewerSystem.Diagnostics.Process.Start(outputPath);
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);
ImportsIronPdf' Render any HTML fragment or document to HTMLPrivate renderer As New ChromePdfRenderer()Private pdf AsPdfDocument = renderer.RenderHtmlAsPdf("<h1>Hello IronPdf</h1>")Private outputPath = "ChromePdfRenderer.pdf"' Export PDF documentpdf.SaveAs(outputPath)' This neat trick opens our PDF file so we can see the result in our default PDF viewerSystem.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)
In production, wrap the call so a missing PDF handler does not crash the app:
try{ var psi = new System.Diagnostics.ProcessStartInfo {FileName = outputPath,UseShellExecute = true };System.Diagnostics.Process.Start(psi);}catch (Exception ex){ // Handle the case where no PDF viewer is installedMessageBox.Show($"Unable to open PDF: {ex.Message}");}
try
{
var psi = new System.Diagnostics.ProcessStartInfo
{
FileName = outputPath,
UseShellExecute = true
};
System.Diagnostics.Process.Start(psi);
}
catch (Exception ex)
{
// Handle the case where no PDF viewer is installed
MessageBox.Show($"Unable to open PDF: {ex.Message}");
}
ImportsSystem.DiagnosticsImportsSystem.Windows.FormsTry Dim psi As New ProcessStartInfoWith { .FileName = outputPath, .UseShellExecute = True }Process.Start(psi)Catch ex AsException ' Handle the case where no PDF viewer is installedMessageBox.Show($"Unable to open PDF: {ex.Message}")EndTry
Imports System.Diagnostics
Imports System.Windows.Forms
Try
Dim psi As New ProcessStartInfo With {
.FileName = outputPath,
.UseShellExecute = True
}
Process.Start(psi)
Catch ex As Exception
' Handle the case where no PDF viewer is installed
MessageBox.Show($"Unable to open PDF: {ex.Message}")
End Try
Conclusion
Each viewing path here trades interactivity for portability: the MAUI viewer gives a full toolbar, rasterizing to images works in any UI on any platform, WebView2 reuses the Edge engine, and Process.Start defers to the user's reader. Pick the one that matches your app rather than forcing a single answer.
Since most viewing starts with a document you generated, pair these techniques with the full MAUI viewer tutorial when you need an interactive toolbar component.
Frequently Asked Questions
How can I embed a PDF in an ASP.NET application using IronPDF?
You can serve the PDF from a controller action and embed it in an HTML iframe. The built-in browser PDF viewer will handle rendering, maintaining your page layout.
What are the different ways to view PDFs in .NET using IronPDF?
IronPDF supports viewing PDFs through the MAUI viewer, by rasterizing pages to images, using WebView2 in WPF and Windows Forms, and by opening with the default system PDF viewer.
How do I display a PDF in a MAUI application using IronPDF?
Install the IronPdf.Viewer.Maui NuGet package, configure it in MauiProgram.cs, and bind a PDF to an IronPdfView using IronPDF’s MAUI viewer component.
Can I convert PDF pages to images for display on any platform with IronPDF?
Yes, you can use the RasterizeToImageFiles method in IronPDF to convert each PDF page into a PNG image, suitable for any UI framework.
What is the advantage of using WebView2 for displaying PDFs in WPF applications?
WebView2 utilizes the Chromium engine from Microsoft Edge, providing built-in PDF viewing features like toolbar, zoom, and print, and is recommended over the older WebBrowser control.
How can I open a PDF in the default system viewer using IronPDF?
Use System.Diagnostics.Process.Start with the PDF file path to open it in the user's default PDF reader, such as a browser or Adobe Acrobat.
Is it possible to display PDFs in Blazor applications with IronPDF?
Yes, you can convert each PDF page to an image using IronPDF's RasterizeToImageFiles, and display those images using an img tag in a Blazor component.
What should I do if the default PDF viewer is not installed on the user's system?
Wrap the System.Diagnostics.Process.Start call in a try-catch block to handle cases where a PDF viewer is missing, ensuring your application does not crash.
How can IronPDF's MAUI viewer enhance my application's PDF viewing experience?
The MAUI viewer provides a full interactive component with a toolbar, allowing users to interact with the PDF directly within your app.
Can I use IronPDF to integrate PDF viewing capabilities without depending on browser controls?
Yes, by rasterizing PDF pages to images, you can integrate viewing capabilities in any UI framework without relying on browser-based controls.
Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.