The C# PDF Library

ironpdf makes it easy to generate pdfs in your .net apps & websites.

C# PDF

PDF Generation for .Net Developers

IronPDF is the fun, stable C# PDF Library. It makes use of skills that developers already have... generating PDFs from C#, Html or Aspx in milliseconds.

Because there is no new API to learn, most coders are up and running in 60 seconds using the Nuget installer for Visual Studio.   Features »   Install Now »

C# HTML TO PDF

IronPdf provides a diverse PDF generation library for C# and .Net developers. It is suitable for use in windows Applications, WPF, MVC and ASPX based .net websites and applications.

IronPDF.ASPXtoPDF

The ASPXtoPDF class allowing any .net web forms web application page (ASPX) to be turned into a PDF. The content remains the same, but the output format becomes a PDF instead of HTML. This functionality can be implemented in 1 line.

The AspxToPdf.FileBehaviour enumeration allows the developer to choose the PDF to behave as either an attachment, or a PDF in browser.

IronPDF.HTMLToPDF

A class allowing the generation of a PDF file from .Net code. The PDF is designed using HTML, wither in the form of inline HTML, or as URL to a web page.

Usging HTML as the design language means makes PDF design and development easy, without needing to learn a long, complex API

IronPDF.PDFPrintOptions

The PDFPrintOptions print options class allows fit tuning of PDF output behavior including:

  • Turning HTML forms into Editable PDF forms data collection
  • Settings High DPI for high quality print jobs
  • Choosing between media='screen' and media='print stylesheets'
  • Enabling or Disabling javascript and AJAX
  • Custom or Standardized Paper sizes
  • Customized paper margins, including zero-margin printing
  • Adding Headers and Footers with optional page-numbering
Requirements

IronPdf can be used in any .Net App or website targeting Framework 4.0 or higher, on the windows platforms.


C# HTML TO PDF

HTML to PDF

The IronPDF HTML to PDF class allows .Net developers to create PDFs from HTML

You can point it to any web-page, or input HTML as a string, and wham - you have created a PDF file with your .Net App or Website.


ASPX TO PDF

ASPX to PDF

The IronPDF ASPX to PDF function is a new concept in PDF generation for ASP.Net Developers that involveds almost no additional coding.

Add IronPDF.ASPXToPDF to any ASPX Web Page to instantly transform it from HTML into an identical Pdf file.

Start generating PDFs in .Net in 60 seconds…

Install C# PDF into Visual Studio

Install IronPDf to your .Net Project

The easiest way to install IronPDf is using NuGet Package Manager for Visual-Studio:

  1. The package name is "IronPdf"
  2. If NuGet is unfamiliar to you… read this tutorial
  3. If you would prefer to download IronPDF as a dll and install manually, be our guest.
C# PDF Example Code Demo

Get Coding

IronPDF has a very simple API based on HTML as a design language:

using IronPdf;

HtmlToPdf HtmlToPdf = new IronPdf.HtmlToPdf();
PdfResource PDF = HtmlToPdf.RenderHtmlAsPdf(@"<h1>Hello World</h1>");
PDF.SaveAs(@"Path\File.Pdf");

// or System.IO.MemoryStream PdfStream = PDF.GetStream;
// or byte[] PdfBinary = PDF.GetBinary;
using IronPdf;

HtmlToPdf HtmlToPdf = new IronPdf.HtmlToPdf();

HtmlToPdf.PrintOptions.DPI = 300;
HtmlToPdf.PrintOptions.PaperSize = PdfPrintOptions.PdfPaperSize.A4;
HtmlToPdf.PrintOptions.EnableJavaScript = true;
HtmlToPdf.PrintOptions.CssMediaType =  PdfPrintOptions.PdfCssMediaType.Screen;
HtmlToPdf.PrintOptions.Header = "{page} of {total-pages}";
HtmlToPdf.PrintOptions.GrayScale = false;
//.. many more options available
using IronPdf;


HtmlToPdf HtmlToPdf = new IronPdf.HtmlToPdf();
PdfResource PDF = HtmlToPdf.RenderUrlAsPdf(new Uri("http://ironpdf.com"));
PDF.SaveAs(@"Path\File.Pdf");


// or System.IO.MemoryStream PdfStream = PDF.GetStream;
// or byte[] PdfBinary = PDF.GetBinary;
using IronPdf;

private void Form1_Load(object sender, EventArgs e)
{
  PDFPrintOptions Options = new PDFPrintOptions()
  {
    DPI = 300,
    EnableJavaScript = false,
     //.. many more options available  
  };
  AspxToPdf.RenderThisPageAsPDF(AspxToPdf.FileBehaviour.Attachment);
}
using IronPdf;

  private void Form1_Load(object sender, EventArgs e)
  {
  //...
  AspxToPdf.RenderThisPageAsPDF();      
  //Changes the ASPX output into a pdf instead of html   
  }
Imports IronPdf

Dim HtmlToPdf As HtmlToPdf = New IronPdf.HtmlToPdf()
Dim PDF As PdfResource = HtmlToPdf.RenderHtmlAsPdf("<h1>Hello World</h1>")
PDF.SaveAs("Path\File.Pdf")
Imports IronPdf

Dim HtmlToPdf As HtmlToPdf = New IronPdf.HtmlToPdf()

HtmlToPdf.PrintOptions.DPI = 300
HtmlToPdf.PrintOptions.PaperSize = PdfPrintOptions.PdfPaperSize.A4
HtmlToPdf.PrintOptions.EnableJavaScript = True
HtmlToPdf.PrintOptions.CssMediaType = PdfPrintOptions.PdfCssMediaType.Screen
HtmlToPdf.PrintOptions.Header = "{page} of {total-pages}"
HtmlToPdf.PrintOptions.GrayScale = False
'.. many more options available
Imports IronPdf

Dim HtmlToPdf As HtmlToPdf = New IronPdf.HtmlToPdf()
Dim PDF As PdfResource = HtmlToPdf.RenderUrlAsPdf(New Uri("http://ironpdf.com"))
PDF.SaveAs("Path\File.Pdf")

Imports IronPdf

Private Sub Form1_Load(sender As Object, e As EventArgs)
  
  Dim Options As New PDFPrintOptions() With { _
  Key .Dpi = 300, _
  Key .EnableJavaScript = False _
  }
  '.. many more options available  
  AspxToPdf.RenderThisPageAsPDF(AspxToPdf.FileBehaviour.Attachment)
End Sub
Imports IronPdf

  Private Sub Form1_Load(sender As Object, e As EventArgs)
  '...
  AspxToPdf.RenderThisPageAsPDF()    
    'Changes the ASPX output into a pdf instead of html   
  End Sub

This is the driod you have been looking for…

C# PDF Gererator Documentation

Well Documented

Clear online manuals in plain English.

C# & VB Docs
C# PDF Library Licensing

Flexibly Licensed

Free Development. Commercial from $199.

Explore Licenses
C# PDF Open-Source Examples

Demos on GitHub

Download four open-source demos.

Coming Soon
visual studio Install C# PDF Generator by IronPdf

1 Minuite Setup

Use Nuget Package Manager to install in under 60 seconds.