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 ViewerFor viewing PDF documents directly in WPF you can use the native WebBrowser control.
Windows Forms PDF ViewerFor 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 ViewerTo 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.
- // Render any HTML fragment or document to HTML
- var Renderer = new IronPdf.HtmlToPdf();
- var PDF = Renderer.RenderHtmlAsPdf(“<h1>Hello IronPdf</h1>”);
- var OutputPath = “HtmlToPDF.pdf”;
- 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);
Copy code to clipboardVB C#