Skip to main content

C# PDF Viewers

C# PDF ViewersPhoto by Thomas Lefebvre

Originally Posted On: https://ironpdf.com/docs/questions/net-pdf-viewer/

 

Viewing PDFs in our applications is a common request that is easily solved.

We are working on a visual framework for viewing PDFs in C#/.Net – in the mean time you have lots of viable free options without resorting to Adobe Acrobat.

ASP.Net & MVC PDF vierwer.

For web applications – PDFs can be viewed in a browser window or iframe. You may also use the amazing pdf.js library from mozilla to leverage a full PDF viewer written in pure javascript code.

https://mozilla.github.io/pdf.js/

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 a 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.

  1. // Render any HTML fragment or document to HTML
  2. var Renderer = new IronPdf.HtmlToPdf();
  3. var PDF = Renderer.RenderHtmlAsPdf(“<h1>Hello IronPdf</h1>”);
  4. var OutputPath = “HtmlToPDF.pdf”;
  5. PDF.SaveAs(OutputPath);
  6. // This neat trick opens our PDF file so we can see the result in our default PDF viewer
  7. System.Diagnostics.Process.Start(OutputPath);

Copy code to clipboardVB  C#

Data & News supplied by www.cloudquote.io
Stock quotes supplied by Barchart
Quotes delayed at least 20 minutes.
By accessing this page, you agree to the following
Privacy Policy and Terms and Conditions.