C# PDF Viewer - FOX21- Entertaining Delmarva One Click at a Time

C# PDF Viewer

Posted:

C# 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 resolting 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);

 

Powered by Frankly
Powered by WorldNowAll content © Copyright 2000 - 2015, WorldNow and EBOC. All Rights Reserved. For more information on this site, please read our Privacy Policy, and Terms of Service, and Ad Choices.