C# VB PDF .NET : Generating PDFs in Blazor Generating PDFs in Blazor
@using IronPdf;
public void ExportData()
{
    try
    {
        string fileName = "Demo.pdf";
        var Renderer = new IronPdf.ChromePdfRenderer();
        var pdf = Renderer.RenderUrlAsPdf("https://localhost:7018/fetchdata");
        JSRuntime.InvokeVoidAsync("saveAsFile", fileName, Convert.ToBase64String(pdf.Stream.ToArray()));
    }
    catch (Exception ex)
    {
    }
}
Private IronPdf As [using]
Public Sub ExportData()
	Try
		Dim fileName As String = "Demo.pdf"
		Dim Renderer = New IronPdf.ChromePdfRenderer()
		Dim pdf = Renderer.RenderUrlAsPdf("https://localhost:7018/fetchdata")
		JSRuntime.InvokeVoidAsync("saveAsFile", fileName, Convert.ToBase64String(pdf.Stream.ToArray()))
	Catch ex As Exception
	End Try
End Sub

IronPDF allows developers to create PDF documents easily in C#, F#, and VB.Net for .NET Core and .NET Framework.

In this example we show that a PDF document can be rendered from any HTML. This allows us to create PDFs that closely match the branding of existing websites.

You can choose simple HTML like the above, or incorporate CSS, images and JavaScript.

This process also allows PDF design to be delegated to web designers, rather than be tasked to back-end coders.

IronPDF uses a pixel perfect Chrome rendering engine to turn your HTML5 with CSS3 and JavaScript support into PDF documents. This can take the form of strings, external files or external URLs, all of which can be rendered to PDF easily using IronPDF.

C# VB PDF .NET : Using HTML To Create a PDF Using HTML To Create a PDF
using IronPdf;

// Instantiate Renderer
var Renderer = new IronPdf.ChromePdfRenderer();

// Create a PDF from a HTML string using C#
var pdf = Renderer.RenderHtmlAsPdf("<h1>Hello World</h1>");

// Export to a file or Stream
pdf.SaveAs("output.pdf");


// Advanced Example with HTML Assets
// Load external html assets: Images, CSS and JavaScript.
// An optional BasePath 'C:\site\assets\' is set as the file location to load assets from 
var myAdvancedPdf = Renderer.RenderHtmlAsPdf("<img src='icons/iron.png'>", @"C:\site\assets\");
myAdvancedPdf.SaveAs("html-with-assets.pdf");
Imports IronPdf

' Instantiate Renderer
Private Renderer = New IronPdf.ChromePdfRenderer()

' Create a PDF from a HTML string using C#
Private pdf = Renderer.RenderHtmlAsPdf("<h1>Hello World</h1>")

' Export to a file or Stream
pdf.SaveAs("output.pdf")


' Advanced Example with HTML Assets
' Load external html assets: Images, CSS and JavaScript.
' An optional BasePath 'C:\site\assets\' is set as the file location to load assets from 
Dim myAdvancedPdf = Renderer.RenderHtmlAsPdf("<img src='icons/iron.png'>", "C:\site\assets\")
myAdvancedPdf.SaveAs("html-with-assets.pdf")

IronPDF allows developers to create PDF documents easily in C#, F#, and VB.Net for .NET Core and .NET Framework.

In this example we show that a PDF document can be rendered from any HTML. This allows us to create PDFs that closely match the branding of existing websites.

You can choose simple HTML like the above, or incorporate CSS, images and JavaScript.

This process also allows PDF design to be delegated to web designers, rather than be tasked to back-end coders.

IronPDF uses a pixel perfect Chrome rendering engine to turn your HTML5 with CSS3 and JavaScript support into PDF documents. This can take the form of strings, external files or external URLs, all of which can be rendered to PDF easily using IronPDF.

C# VB PDF .NET : Converting a URL to a PDF Converting a URL to a PDF
using IronPdf;

// Instantiate Renderer
var Renderer = new IronPdf.ChromePdfRenderer();

// Create a PDF from a URL or local file path
var pdf = Renderer.RenderUrlAsPdf("https://ironpdf.com/");

// Export to a file or Stream
pdf.SaveAs("url.pdf");
Imports IronPdf

' Instantiate Renderer
Private Renderer = New IronPdf.ChromePdfRenderer()

' Create a PDF from a URL or local file path
Private pdf = Renderer.RenderUrlAsPdf("https://ironpdf.com/")

' Export to a file or Stream
pdf.SaveAs("url.pdf")

IronPDF makes it very straightforward to render HTML from existing URLs as PDF documents. There is a very high level of support for JavaScript, Images, Forms and CSS.

Rendering PDFs from ASP.NET URLs which accept query string variables can make PDF development an easy collaboration between designers and coders.


Creating PDF Document from URL

Creating a pdf file in C# using a URL is just as easy as the above example with just these three lines of code, following code will demonstrate how to create pdf files from a URL.

Here is the output of the above code.

Other examples of converting popular complex sites to PDF.

You can download a file project from this link.

C# VB PDF .NET : PDF Generation Settings PDF Generation Settings
using IronPdf;
using IronPdf.Engines.Chrome;

// Instantiate Renderer
var Renderer = new ChromePdfRenderer();
 
// Many rendering options to use to customize!
Renderer.RenderingOptions.SetCustomPaperSizeInInches(12.5, 20);
Renderer.RenderingOptions.PrintHtmlBackgrounds = true;
Renderer.RenderingOptions.PaperOrientation = IronPdf.Rendering.PdfPaperOrientation.Landscape;
Renderer.RenderingOptions.Title = "My PDF Document Name";
Renderer.RenderingOptions.EnableJavaScript = true;
Renderer.RenderingOptions.RenderDelay = 50; // in milliseconds
Renderer.RenderingOptions.CssMediaType = IronPdf.Rendering.PdfCssMediaType.Screen;
Renderer.RenderingOptions.FitToPaperMode = FitToPaperModes.None;
Renderer.RenderingOptions.Zoom = 100;
Renderer.RenderingOptions.CreatePdfFormsFromHtml = true; 

// Supports margin customization!
Renderer.RenderingOptions.MarginTop = 40;  //millimeters
Renderer.RenderingOptions.MarginLeft = 20;  //millimeters
Renderer.RenderingOptions.MarginRight = 20;  //millimeters
Renderer.RenderingOptions.MarginBottom = 40;  //millimeters
 
// Can set FirstPageNumber if you have a coverpage
Renderer.RenderingOptions.FirstPageNumber = 1; // use 2 if a coverpage will be appended
 
// Settings have been set, we can render:
Renderer.RenderHtmlFileAsPdf("assets/wikipedia.html").SaveAs("output/my-content.pdf");
Imports IronPdf
Imports IronPdf.Engines.Chrome

' Instantiate Renderer
Private Renderer = New ChromePdfRenderer()

' Many rendering options to use to customize!
Renderer.RenderingOptions.SetCustomPaperSizeInInches(12.5, 20)
Renderer.RenderingOptions.PrintHtmlBackgrounds = True
Renderer.RenderingOptions.PaperOrientation = IronPdf.Rendering.PdfPaperOrientation.Landscape
Renderer.RenderingOptions.Title = "My PDF Document Name"
Renderer.RenderingOptions.EnableJavaScript = True
Renderer.RenderingOptions.RenderDelay = 50 ' in milliseconds
Renderer.RenderingOptions.CssMediaType = IronPdf.Rendering.PdfCssMediaType.Screen
Renderer.RenderingOptions.FitToPaperMode = FitToPaperModes.None
Renderer.RenderingOptions.Zoom = 100
Renderer.RenderingOptions.CreatePdfFormsFromHtml = True

' Supports margin customization!
Renderer.RenderingOptions.MarginTop = 40 'millimeters
Renderer.RenderingOptions.MarginLeft = 20 'millimeters
Renderer.RenderingOptions.MarginRight = 20 'millimeters
Renderer.RenderingOptions.MarginBottom = 40 'millimeters

' Can set FirstPageNumber if you have a coverpage
Renderer.RenderingOptions.FirstPageNumber = 1 ' use 2 if a coverpage will be appended

' Settings have been set, we can render:
Renderer.RenderHtmlFileAsPdf("assets/wikipedia.html").SaveAs("output/my-content.pdf")

IronPDF aims to be as flexible as possible for the developer.

In this example, we show the balance between providing an API that automates internal functionality and providing one that gives you control.

IronPDF supports many customizations for generated PDF files, including: page sizing, page margins, header/footer content, content scaling, CSS rulesets, and JavaScript execution.


We want developers to be able to control how Chrome turns a web page into a PDF. The ChromePdfRenderer class makes this possible.

Examples of settings available on the ChromePDFRenderOptions class include settings for margins, headers, footers, paper size, and form creation.

C# VB PDF .NET : Rendering ASPX Pages as PDFs Rendering ASPX Pages as PDFs
private void Form1_Load(object sender, EventArgs e)
{
	//Changes the ASPX output into a pdf instead of HTML
	IronPdf.AspxToPdf.RenderThisPageAsPdf();
}
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
	'Changes the ASPX output into a pdf instead of HTML
	IronPdf.AspxToPdf.RenderThisPageAsPdf()
End Sub

Using the IronPDF library, ASP.NET web pages can be rendered to PDF instead of HTML by adding a single line of code to the Form_Load event.

This example shows how IronPDF can produce complex, data-driven PDFs that are designed and tested as HTML first for simplicity.

IronPDF's ASPX to PDF functionality allows you to call a single method within an ASPX page and have it return a PDF instead of HTML.

You can code the PDF to either display "in-browser," or to be behave as a file download.

C# VB PDF .NET : HTML or Image File to PDF HTML or Image File to PDF
using IronPdf;

// Instantiate Renderer
var Renderer = new IronPdf.ChromePdfRenderer();

// Create a PDF from an existing HTML file using C#
var pdf = Renderer.RenderHtmlFileAsPdf("example.html");

// Export to a file or Stream
pdf.SaveAs("output.pdf");
Imports IronPdf

' Instantiate Renderer
Private Renderer = New IronPdf.ChromePdfRenderer()

' Create a PDF from an existing HTML file using C#
Private pdf = Renderer.RenderHtmlFileAsPdf("example.html")

' Export to a file or Stream
pdf.SaveAs("output.pdf")

One of the easiest ways to use IronPDF is to tell it to render an HTML file.

IronPDF can render any HTML file saved on a machine.

In this example, we show that all relative assets such as CSS, images and JavaScript will be rendered as if the file had been opened using the file:// protocol.

This method has the advantage of allowing the developer the opportunity to test the HTML content in a browser during development. They can, in particular, test the fidelity in rendering. We recommend Chrome, as it is the web browser on which IronPDF's rendering engine is based.

If it looks right in Chrome, then it will be  pixel-perfect in IronPDF as well.

C# VB PDF .NET : ASPX To PDF Settings ASPX To PDF Settings
using IronPdf;


var PdfOptions = new IronPdf.ChromePdfRenderOptions()
{
    CreatePdfFormsFromHtml = true,
    EnableJavaScript = false,
    Title = "My ASPX Page Rendered as a PDF"
    //.. many more options available
};

AspxToPdf.RenderThisPageAsPdf(AspxToPdf.FileBehavior.Attachment, "MyPdfFile.pdf", PdfOptions);
Imports IronPdf


Private PdfOptions = New IronPdf.ChromePdfRenderOptions() With {
	.CreatePdfFormsFromHtml = True,
	.EnableJavaScript = False,
	.Title = "My ASPX Page Rendered as a PDF"
}

AspxToPdf.RenderThisPageAsPdf(AspxToPdf.FileBehavior.Attachment, "MyPdfFile.pdf", PdfOptions)

This example demonstrates how the user can change PDF print options to turn form into HTML.

IronPDF's ASPX to PDF functionality has many options available for rendering HTML to PDF from a string or a file.

Two options of particular importance are:

  • Allowing developers to specify if HTML forms should be rendered as interactive PDF forms during conversion.
  • Allowing developers to specify if the PDF should be displayed "in browser," or as a file download.

C# VB PDF .NET : Image To PDF Image To PDF
using IronPdf;
using System.IO;
using System.Linq;

// One or more images as IEnumerable. This example selects all JPEG images in a specific 'assets' folder.
var ImageFiles = System.IO.Directory.EnumerateFiles("assets").Where(f => f.EndsWith(".jpg") || f.EndsWith(".jpeg"));

// Converts the images to a PDF and save it.
ImageToPdfConverter.ImageToPdf(ImageFiles).SaveAs("composite.pdf");

// Also see PdfDocument.RasterizeToImageFiles() method to flatten a PDF to images or thumbnails
Imports IronPdf
Imports System.IO
Imports System.Linq

' One or more images as IEnumerable. This example selects all JPEG images in a specific 'assets' folder.
Private ImageFiles = System.IO.Directory.EnumerateFiles("assets").Where(Function(f) f.EndsWith(".jpg") OrElse f.EndsWith(".jpeg"))

' Converts the images to a PDF and save it.
ImageToPdfConverter.ImageToPdf(ImageFiles).SaveAs("composite.pdf")

' Also see PdfDocument.RasterizeToImageFiles() method to flatten a PDF to images or thumbnails

This basic tutorial will teach you how to convert an image to PDF in C#. Following the steps outlined below and running the code snippet in your project, you can create a C# image-to-PDF conversion application. Furthermore, you do not need to install any other image processing software to use the image conversion feature.

There are numerous online and software tools now available for converting images to PDFs. Their numbers are growing by the day. The main reason for this is their widespread use. People frequently need to convert their images to PDFs for various reasons.

What is IronPDF?

The IronPDF .NET PDF Library helps developers create a .NET PDF processing application. IronPDF ensures that PDF conversions from different formats is easy and time-efficient. Developers can also use this library to create PDF files from HTML, JavaScript and CSS. It can easily edit documents to include additional text, graphics, and watermarks. It also makes it very easy to read PDF text, extract images, and convert images to PDF programmatically.

Convert JPG Images to PDF Formats

With IronPDF, you can convert JPG images to PDF files with a single line of code. IronPDF's ImageToPdf method can be used to complete this task. To convert any JPG image to a PDF document, use the System.IO.Directory to enumerate the folder containing the image, and pass it to the ImageToPDF method.

ImageToPdfConverter.ImageToPdf(Image).SaveAs("composite.pdf");

Combine multiple images into a PDF File

We can also convert images to PDFs in batch into a single PDF document using System.IO.Directory.EnumerateFiles along with ImageToPdfConverter.ImageToPdf, as shown below.

    string sourceDirectory = "D:\web\assets";
    string destinationFile = "JpgToPDF.pdf";
    var imageFiles = Directory.EnumerateFiles(sourceDirectory, "*.jpg");
    ImageToPdfConverter.ImageToPdf(imageFiles).SaveAs(destinationFile);

Conclusion

In this tutorial, we learned a simple method for converting images to PDF files. We used code to demonstrate examples and converted a single image to a PDF. We've also combined several images into a single PDF document.

IronPDF is one of the available libraries included in Iron Software's IronSuite. The IronSuite also includes IronXL, IronBarode, IronOCR, and IronWebScraper. Purchase the entire IronSuite and save up to 250%. All five products are currently available for the price of just two of them.


PDF documents can be easily constructed from one or more image files using the IronPdf.ImageToPdfConverter Class.

You can download a file project from this link.

C# VB PDF .NET : HTML Headers & Footers HTML Headers & Footers
using IronPdf;
 
// Instantiate Renderer
var Renderer = new IronPdf.ChromePdfRenderer();
 
 
// Build a footer using html to style the text
// mergeable fields are:
// {page} {total-pages} {url} {date} {time} {html-title} & {pdf-title}
Renderer.RenderingOptions.HtmlFooter = new HtmlHeaderFooter()
{
	MaxHeight = 15, //millimeters
	HtmlFragment = "<center><i>{page} of {total-pages}<i></center>",
	DrawDividerLine = true
};

// Use sufficient MarginBottom to ensure that the HtmlFooter does not overlap with the main PDF page content.
Renderer.RenderingOptions.MarginBottom = 25;  //mm


// Build a header using an image asset
// Note the use of BaseUrl to set a relative path to the assets
Renderer.RenderingOptions.HtmlHeader = new HtmlHeaderFooter()
{
	MaxHeight = 20, //millimeters
	HtmlFragment = "<img src='logo.png'>",
	BaseUrl = new Uri(@"C:\assets\images\").AbsoluteUri
};

// Use sufficient MarginTop to ensure that the HtmlHeader does not overlap with the main PDF page content. 
Renderer.RenderingOptions.MarginTop = 25; //mm
Imports IronPdf

' Instantiate Renderer
Private Renderer = New IronPdf.ChromePdfRenderer()


' Build a footer using html to style the text
' mergeable fields are:
' {page} {total-pages} {url} {date} {time} {html-title} & {pdf-title}
Renderer.RenderingOptions.HtmlFooter = New HtmlHeaderFooter() With {
	.MaxHeight = 15,
	.HtmlFragment = "<center><i>{page} of {total-pages}<i></center>",
	.DrawDividerLine = True
}

' Use sufficient MarginBottom to ensure that the HtmlFooter does not overlap with the main PDF page content.
Renderer.RenderingOptions.MarginBottom = 25 'mm


' Build a header using an image asset
' Note the use of BaseUrl to set a relative path to the assets
Renderer.RenderingOptions.HtmlHeader = New HtmlHeaderFooter() With {
	.MaxHeight = 20,
	.HtmlFragment = "<img src='logo.png'>",
	.BaseUrl = (New Uri("C:\assets\images\")).AbsoluteUri
}

' Use sufficient MarginTop to ensure that the HtmlHeader does not overlap with the main PDF page content. 
Renderer.RenderingOptions.MarginTop = 25 'mm

The HTML headers and footers are rendered as independent HTML documents which may have their own assets and stylesheets. It gives developers total control over how their headers and footers look. The height of the rendered headers or footers can be controlled to match their content exactly.

In this example, we show how to add HTML headers and footers to your PDF documents in IronPDF.

HTML headers or footers will be printed onto every page of the PDF when you add them to your project. This can be used to override classic headers and footers.

When using HtmlHeaderFooter, it is important to set HtmlFragment, which will be used to render the headers or footers. It should be an HTML snippet rather than a complete document. It may also contain styles & images.

You can also merge meta-data into your HTML using any of these placeholder strings such as {page} {total-pages} {url} {date} {time} {html-title} {pdf-title}.

C# VB PDF .NET : Simple Headers & Footers Simple Headers & Footers
using IronPdf;
 
// Initiate PDF Renderer
var Renderer = new IronPdf.ChromePdfRenderer();
 
// Add a header to every page easily
Renderer.RenderingOptions.FirstPageNumber = 1; // use 2 if a cover page  will be appended
Renderer.RenderingOptions.TextHeader.DrawDividerLine = true;
Renderer.RenderingOptions.TextHeader.CenterText = "{url}";
Renderer.RenderingOptions.TextHeader.Font = IronPdf.Font.FontTypes.Helvetica;
Renderer.RenderingOptions.TextHeader.FontSize = 12;
Renderer.RenderingOptions.MarginTop = 25; //create 25mm space for header
 
// Add a footer too
Renderer.RenderingOptions.TextFooter.DrawDividerLine = true;
Renderer.RenderingOptions.TextFooter.Font = IronPdf.Font.FontTypes.Arial;
Renderer.RenderingOptions.TextFooter.FontSize = 10;
Renderer.RenderingOptions.TextFooter.LeftText = "{date} {time}";
Renderer.RenderingOptions.TextFooter.RightText = "{page} of {total-pages}";
Renderer.RenderingOptions.MarginTop = 25; //create 25mm space for footer

// Mergeable fields are:
// {page} {total-pages} {url} {date} {time} {html-title} & {pdf-title}
Imports IronPdf

' Initiate PDF Renderer
Private Renderer = New IronPdf.ChromePdfRenderer()

' Add a header to every page easily
Renderer.RenderingOptions.FirstPageNumber = 1 ' use 2 if a cover page  will be appended
Renderer.RenderingOptions.TextHeader.DrawDividerLine = True
Renderer.RenderingOptions.TextHeader.CenterText = "{url}"
Renderer.RenderingOptions.TextHeader.Font = IronPdf.Font.FontTypes.Helvetica
Renderer.RenderingOptions.TextHeader.FontSize = 12
Renderer.RenderingOptions.MarginTop = 25 'create 25mm space for header

' Add a footer too
Renderer.RenderingOptions.TextFooter.DrawDividerLine = True
Renderer.RenderingOptions.TextFooter.Font = IronPdf.Font.FontTypes.Arial
Renderer.RenderingOptions.TextFooter.FontSize = 10
Renderer.RenderingOptions.TextFooter.LeftText = "{date} {time}"
Renderer.RenderingOptions.TextFooter.RightText = "{page} of {total-pages}"
Renderer.RenderingOptions.MarginTop = 25 'create 25mm space for footer

' Mergeable fields are:
' {page} {total-pages} {url} {date} {time} {html-title} & {pdf-title}

Headers and Footers may be added to PDF documents in two distinct ways.

  • Classic text headers and footers, which allows text-based headers to be added, with the option to merge in dynamic data.
  • HTML headers and footers, which allows the developer to render HTML headers and footers to PDF files, also allowing the templating of dynamic data. This method is more flexible, although it is harder to use.

The class TextHeaderFooter in IronPDF defines PDF headers and footers display options. This uses a logical approach to rendering headers and footers for the most common use cases.

In this example, we show you how to add classic text headers and footers to your PDF documents in IronPDF.

When adding headers and footers to your document, you have the option to set the headers text to be centered on the PDF document. You can also merge metadata into your header using placeholder strings. You can find these strings here. You can also add a horizontal line divider between the headers or footers and the page content on every page of the PDF document, influence font and font sizes etc. It is a very useful feature that ticks all the boxes. 

C# VB PDF .NET : Editing PDFs Editing PDFs
using IronPdf;
using System.Collections.Generic;

// Instantiate Renderer
var Renderer = new IronPdf.ChromePdfRenderer();

// Join Multiple Existing PDFs into a single document
var PDFs = new List<PdfDocument>();
PDFs.Add(PdfDocument.FromFile("A.pdf"));
PDFs.Add(PdfDocument.FromFile("B.pdf"));
PDFs.Add(PdfDocument.FromFile("C.pdf"));
PdfDocument PDF = PdfDocument.Merge(PDFs);
PDF.SaveAs("merged.pdf");

// Add a cover page
PDF.PrependPdf(Renderer.RenderHtmlAsPdf("<h1>Cover Page</h1><hr>"));

// Remove the last page from the PDF and save again
PDF.RemovePage(PDF.PageCount - 1);
PDF.SaveAs("merged.pdf");

// Copy pages 5-7 and save them as a new document.
PDF.CopyPages(4, 6).SaveAs("exerpt.pdf");

foreach (var pdf in PDFs)
{
	pdf.Dispose();
}
Imports IronPdf
Imports System.Collections.Generic

' Instantiate Renderer
Private Renderer = New IronPdf.ChromePdfRenderer()

' Join Multiple Existing PDFs into a single document
Private PDFs = New List(Of PdfDocument)()
PDFs.Add(PdfDocument.FromFile("A.pdf"))
PDFs.Add(PdfDocument.FromFile("B.pdf"))
PDFs.Add(PdfDocument.FromFile("C.pdf"))
Dim PDF As PdfDocument = PdfDocument.Merge(PDFs)
PDF.SaveAs("merged.pdf")

' Add a cover page
PDF.PrependPdf(Renderer.RenderHtmlAsPdf("<h1>Cover Page</h1><hr>"))

' Remove the last page from the PDF and save again
PDF.RemovePage(PDF.PageCount - 1)
PDF.SaveAs("merged.pdf")

' Copy pages 5-7 and save them as a new document.
PDF.CopyPages(4, 6).SaveAs("exerpt.pdf")

'INSTANT VB NOTE: The variable pdf was renamed since Visual Basic will not allow local variables with the same name as parameters or other local variables:
For Each Me.pdf_Conflict In PDFs
	Me.pdf_Conflict.Dispose()
Next pdf_Conflict

Our Engineering team has written a comprehensive tutorial that explores IronPDF's PDF editing capabilities in great detail. Read this article to learn how to make full use of IronPDF to modify PDF documents to best suit project requirements.


IronPDF allows many PDF file editing manipulations. The most popular are merging, cloning and extracting pages.

PDF may also be watermarked, stamped and have backgrounds and foregrounds applied.

Do you have trouble finding a C# PDF editor for the .NET platform?

IronPDF is an all-in-one PDF library solution. No matter what your PDF issue is, IronPDF has the perfect solution for you. Editing PDF files using IronPDF ensures a wide range of options becomes available, including merging PDF files, adding cover pages, removing the last page from a PDF document, splitting PDF files, using PDF annotations, and many other tools for manipulating PDFs.

IronPDF is the Best C# Library for PDF Files and PDF Document Editing

IronPDF is free to use. This PDF library for developers offers many functionalities for PDF-related editing. Its top-of-the-line features are converting HTML to PDF files, creating new PDF files, saving PDF pages, inserting and deleting images from PDFs, and opening those PDF files created by Microsoft Office. It also supports all types of image and file formats. Writing source code has never been easier, and IronPDF supports many frameworks including the .NET framework and .NET core. In short, IronPDF is very helpful to its users and addresses all their PDF issues.

C# PDF Editor Integration

You can easily integrate the IronPDF PDF Editor into your project using the NuGet project manager console, and then use IronPDF in your console application.

  • Go to Tools and open the NuGet Console in Visual Studio.

  • In the Console, write "install package IronPDF" and press Enter.

  • Then, simply copy the above sample code or write your own source code.

Why use IronPDF for Editing PDFs?

When using IronPDF you'll see that the PDF library offers a wide range of functions that make it easy to work with PDFs. You are free to explore the class and function. You may make a C# Windows Form sample or another major product to see the perfect outcome of reading the PDF. IronPDF provides source code and tutorials for all its features. To create a new page or new pages, fill out Windows Forms in the input file just write a few lines of code in the "static void main" method and run the application. IronPDF provides free support to its users for any problems they face, as well as any kind of information they need about IronPDF.

IronPDF Extra Editing Features and Supported File Formats

IronPDF allows its users to add watermarks, rotate pages, add annotations, digitally sign PDF pages, create PDF new documents, attach cover pages, customize PDF sizes, and much more when generating and formatting PDF files.

IronPDF offers 50+ features to read and edit PDFs. It supports all types of file formats, including images such as JPG, BMP, JPEG, GIF, PNG, TIFF, etc. In addition to all of this, the IronPDF library supports PDF imaging. This feature has the ability to convert any number of photos to PDFs and vice versa with a single line of code.

IronPDF Licensing and the Iron Suite

IronPDF is free for developers, but to deploy your project live you need a license key. IronPDF offers three distinctive license packages according to users' needs. The Basic Lite Package starts from $749. IronPDF licenses are for a lifetime, and there are options for both free and paid support, as well as version updates from any location at any time.

The Lite Package for the Iron Suite starts from just $1498. To get more information and check our price structure, please visit this link.

C# VB PDF .NET : Passwords, Security and MetaData Passwords, Security and MetaData
using IronPdf;

//Open an Encrypted File, alternatively create a new PDF from Html
var Pdf = PdfDocument.FromFile("encrypted.pdf", "password");

//Edit file metadata
Pdf.MetaData.Author = "Satoshi Nakamoto";
Pdf.MetaData.Keywords = "SEO, Friendly";
Pdf.MetaData.ModifiedDate = System.DateTime.Now;

//Edit file security settings

//The following code makes a PDF read only and will disallow copy & paste and printing
Pdf.SecuritySettings.RemovePasswordsAndEncryption();
Pdf.SecuritySettings.MakePdfDocumentReadOnly("secret-key");
Pdf.SecuritySettings.AllowUserAnnotations = false;
Pdf.SecuritySettings.AllowUserCopyPasteContent = false;
Pdf.SecuritySettings.AllowUserFormData = false;
Pdf.SecuritySettings.AllowUserPrinting = IronPdf.Security.PdfPrintSecurity.FullPrintRights;

//Change or set the document encrpytion password
Pdf.SecuritySettings.OwnerPassword = "top-secret"; // password to edit the pdf
Pdf.SecuritySettings.UserPassword = "sharable";  // password to open the pdf
Pdf.SaveAs("secured.pdf");
Imports System
Imports IronPdf

'Open an Encrypted File, alternatively create a new PDF from Html
Private Pdf = PdfDocument.FromFile("encrypted.pdf", "password")

'Edit file metadata
Pdf.MetaData.Author = "Satoshi Nakamoto"
Pdf.MetaData.Keywords = "SEO, Friendly"
Pdf.MetaData.ModifiedDate = DateTime.Now

'Edit file security settings

'The following code makes a PDF read only and will disallow copy & paste and printing
Pdf.SecuritySettings.RemovePasswordsAndEncryption()
Pdf.SecuritySettings.MakePdfDocumentReadOnly("secret-key")
Pdf.SecuritySettings.AllowUserAnnotations = False
Pdf.SecuritySettings.AllowUserCopyPasteContent = False
Pdf.SecuritySettings.AllowUserFormData = False
Pdf.SecuritySettings.AllowUserPrinting = IronPdf.Security.PdfPrintSecurity.FullPrintRights

'Change or set the document encrpytion password
Pdf.SecuritySettings.OwnerPassword = "top-secret" ' password to edit the pdf
Pdf.SecuritySettings.UserPassword = "sharable" ' password to open the pdf
Pdf.SaveAs("secured.pdf")

Granular meta-data and security settings can be applied. This now includes the ability to limit PDF documents to be unprintable, read only and encrypted. 128 bit encryption, decryption and password protection of PDF documents is supported.

C# VB PDF .NET : PDF Watermarking PDF Watermarking
using IronPdf;

// Stamps a Watermark onto a new or existing PDF
var Renderer = new ChromePdfRenderer();

var Pdf = Renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf");
Pdf.ApplyWatermark("<h2 style='color:red'>SAMPLE</h2>", 30, IronPdf.Editing.VerticalAlignment.Middle, IronPdf.Editing.HorizontalAlignment.Center);
Pdf.SaveAs(@"C:\Path\To\Watermarked.pdf");
Imports IronPdf

' Stamps a Watermark onto a new or existing PDF
Private Renderer = New ChromePdfRenderer()

Private Pdf = Renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf")
Pdf.ApplyWatermark("<h2 style='color:red'>SAMPLE</h2>", 30, IronPdf.Editing.VerticalAlignment.Middle, IronPdf.Editing.HorizontalAlignment.Center)
Pdf.SaveAs("C:\Path\To\Watermarked.pdf")

Are you looking for how to add a watermark to PDF documents pragmatically using C# .NET platform?

First, take look at "what a watermark is and why it is important". A watermark is a word or picture that appears in the foreground and background of existing text documents, similar to a stamp, in a PDF. You may, for example, use a "Confidential" watermark on pages that contain sensitive information.

IronPDF can provide the perfect solution to all of your PDF document watermarking needs, like the need to add watermark images to a PDF document on a single page, or on multiple pages, and also provides support if you need to add a watermark to pdf files as a whole.

IronPDF provides methods to 'watermark' PDF documents with HTML. Watermarks may be set to render above or below existing content, and have built in capacity for opacity, rotation and hyperlinks.

You can download a file project from this link.

Best .NET Library for Adding Text and Image Watermark to PDF

IronPDF has the market-leading .NET library for PDF file watermarking. IronPDF makes it easy for developers to add both text and image-based watermarks to PDF pages. To add watermark images to a PDF file, IronPDF allows its users multiple options to manipulate watermarks in the PDF file.

  • watermark single page
  • watermark all the pages
  • watermark text pages of your choice
  • adjust watermark location
  • adjust watermark position

Why use IronPDF for Adding Watermark to PDF File

IronPDF leads the PDF industry and offers all types of PDF manipulating and formatting features. Using IronPDF you can add PDF watermarks to new documents as well as existing PDF files.

Are you worried about how to add a text watermark or an image watermark to a PDF file using the .NET platform?

With only a few lines of code, IronPDF handles the watermarking process, and also allows users to add an image watermark from different image formats like PNG and PNGP, and many more.

Steps To Add Watermark in PDF file

  • Download and install the IronPDF library.
  • Create a new document or use an existing pdf file.
  • Copy from the code snippet or write simple code in the static void main method.
  • Then run the application to check the output PDF file with the watermark.

IronPDF Capabilities

IronPDF .NET library features all the PDF-related textual solutions whether you want to customize font, add a text watermark, read PDF files using string, add a cover page in place of a first page, and all the PDF specification effects.

IronPDF support nearly all the operating system compatible with PDF out there. IronPDF allows its developer to have royal control in formatting PDFs. IronPDF supports a lot of images formats like BMP, JPEG, GIF, PNG, and TIFF Files. you can also read and save PDF files with just a single line of code.

About IronSuite

The IronSuite is a bundle of state-of-the-art products from Iron Software. The suite includes 5 leading digital solutions tools:

  • IronPDF
  • IronOCR
  • IronBarCode
  • IronXL
  • IronWebScraper

You can purchase all the five Iron Software products for the price of just two licenses. Iron Software's clientele is based on the fortune of 500 companies, including some big names like NASA and Tesla.

C# VB PDF .NET : Backgrounds & Foregrounds Backgrounds & Foregrounds
using IronPdf;

// With IronPDF, we can easily merge 2 PDF files using one as a background or foreground
var Renderer = new IronPdf.ChromePdfRenderer();
var pdf = Renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf");
pdf.AddBackgroundPdf(@"MyBackground.pdf");
pdf.AddForegroundOverlayPdfToPage(0, @"MyForeground.pdf", 0);
pdf.SaveAs(@"C:\Path\To\Complete.pdf");
Imports IronPdf

' With IronPDF, we can easily merge 2 PDF files using one as a background or foreground
Private Renderer = New IronPdf.ChromePdfRenderer()
Private pdf = Renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf")
pdf.AddBackgroundPdf("MyBackground.pdf")
pdf.AddForegroundOverlayPdfToPage(0, "MyForeground.pdf", 0)
pdf.SaveAs("C:\Path\To\Complete.pdf")

You may want to use a specific background and foreground as you create and render your PDF documents in IronPDF. In such a case, you can use an existing or rendered PDF as the background or foreground for another PDF document. This is particularly useful for design consistency and templating.

This example shows you how to use a PDF document as the background or foreground of another PDF document. 

You can do this in C# by loading or creating a multi-page PDF as an IronPdf.PdfDocument object.

You can add backgrounds using PdfDocument.AddBackgroundPdf. There are several background insertion methods and overrides in the IronPdf.PdfDocument documentation. This adds a background to each page of your working PDF. The background is copied from a page in another PDF document.


You can add foregrounds, also known as "Overlays," using PdfDocument.AddForegroundOverlayPdfToPage. There are several foreground insertion methods and overrides in the IronPdf.PdfDocument documentation.

C# VB PDF .NET : Form Data Form Data
using IronPdf;
// Step 1.  Creating a PDF with editable forms from HTML using form and input tags
// Radio Button and Checkbox can also be implimented with input type 'radio' and 'checkbox'
var FormHtml = @"
            <html>
                <body>
                    <h2>Editable PDF  Form</h2>
                    <form>
                      First name: <br> <input type='text' name='firstname' value=''> <br>
                      Last name: <br> <input type='text' name='lastname' value=''> <br>
                      <br>
                      <p>Please specify your gender:</p>
                      <input type='radio' id='female' name='gender' value= 'Female'>
                        <label for='female'>Female</label> <br>
                        <br>
                      <input type='radio' id='male' name='gender' value='Male'>
                        <label for='male'>Male</label> <br>
                        <br>
                      <input type='radio' id='non-binary/other' name='gender' value='Non-Binary / Other'>
                        <label for='non-binary/other'>Non-Binary / Other</label>
                      <br>
                      
                      <p>Please select all medical conditions that apply:</p>
                      <input type='checkbox' id='condition1' name='Hypertension' value='Hypertension'>
                      <label for='condition1'> Hypertension</label><br>
                      <input type='checkbox' id='condition2' name='Heart Disease' value='Heart Disease'>
                      <label for='condition2'> Heart Disease</label><br>
                      <input type='checkbox' id='condition3' name='Stoke' value='Stoke'>
                      <label for='condition3'> Stoke</label><br>
                      <input type='checkbox' id='condition4' name='Diabetes' value='Diabetes'>
                      <label for='condition4'> Diabetes</label><br>
                      <input type='checkbox' id='condition5' name='Kidney Disease' value='Kidney Disease'>
                      <label for='condition5'> Kidney Disease</label><br>
                    </form>
                </body>
            </html>";
// Instantiate Renderer
var Renderer = new IronPdf.ChromePdfRenderer();
Renderer.RenderingOptions.CreatePdfFormsFromHtml = true;
Renderer.RenderHtmlAsPdf(FormHtml).SaveAs("BasicForm.pdf");
// Step 2. Reading and Writing PDF form values.
var FormDocument = PdfDocument.FromFile("BasicForm.pdf");
// Set and Read the value of the "firstname" field
var FirstNameField = FormDocument.Form.GetFieldByName("firstname");
FirstNameField.Value = "Minnie";
Console.WriteLine("FirstNameField value: {0}", FirstNameField.Value);
// Set and Read the value of the "lastname" field
IronPdf.Forms.FormField LastNameField = FormDocument.Form.GetFieldByName("lastname");
LastNameField.Value = "Mouse";
Console.WriteLine("LastNameField value: {0}", LastNameField.Value);
FormDocument.SaveAs("FilledForm.pdf");
Imports IronPdf
' Step 1.  Creating a PDF with editable forms from HTML using form and input tags
' Radio Button and Checkbox can also be implimented with input type 'radio' and 'checkbox'
Private FormHtml = "
            <html>
                <body>
                    <h2>Editable PDF  Form</h2>
                    <form>
                      First name: <br> <input type='text' name='firstname' value=''> <br>
                      Last name: <br> <input type='text' name='lastname' value=''> <br>
                      <br>
                      <p>Please specify your gender:</p>
                      <input type='radio' id='female' name='gender' value= 'Female'>
                        <label for='female'>Female</label> <br>
                        <br>
                      <input type='radio' id='male' name='gender' value='Male'>
                        <label for='male'>Male</label> <br>
                        <br>
                      <input type='radio' id='non-binary/other' name='gender' value='Non-Binary / Other'>
                        <label for='non-binary/other'>Non-Binary / Other</label>
                      <br>
                      
                      <p>Please select all medical conditions that apply:</p>
                      <input type='checkbox' id='condition1' name='Hypertension' value='Hypertension'>
                      <label for='condition1'> Hypertension</label><br>
                      <input type='checkbox' id='condition2' name='Heart Disease' value='Heart Disease'>
                      <label for='condition2'> Heart Disease</label><br>
                      <input type='checkbox' id='condition3' name='Stoke' value='Stoke'>
                      <label for='condition3'> Stoke</label><br>
                      <input type='checkbox' id='condition4' name='Diabetes' value='Diabetes'>
                      <label for='condition4'> Diabetes</label><br>
                      <input type='checkbox' id='condition5' name='Kidney Disease' value='Kidney Disease'>
                      <label for='condition5'> Kidney Disease</label><br>
                    </form>
                </body>
            </html>"
' Instantiate Renderer
Private Renderer = New IronPdf.ChromePdfRenderer()
Renderer.RenderingOptions.CreatePdfFormsFromHtml = True
Renderer.RenderHtmlAsPdf(FormHtml).SaveAs("BasicForm.pdf")
' Step 2. Reading and Writing PDF form values.
Dim FormDocument = PdfDocument.FromFile("BasicForm.pdf")
' Set and Read the value of the "firstname" field
Dim FirstNameField = FormDocument.Form.GetFieldByName("firstname")
FirstNameField.Value = "Minnie"
Console.WriteLine("FirstNameField value: {0}", FirstNameField.Value)
' Set and Read the value of the "lastname" field
Dim LastNameField As IronPdf.Forms.FormField = FormDocument.Form.GetFieldByName("lastname")
LastNameField.Value = "Mouse"
Console.WriteLine("LastNameField value: {0}", LastNameField.Value)
FormDocument.SaveAs("FilledForm.pdf")

You can create editable PDF documents with IronPDF as easily as a normal document. The PdfForm class is a collection of user-editable form fields within a PDF document. It can be implemented into your PDF render to make it a form or an editable document.

This example shows you how to create editable PDF forms in IronPDF.

PDFs with editable forms can be created from HTML simply by adding <form>, <input>, and <textarea> tags to the document parts.

The PdfDocument.Form.GetFieldByName can be used to read and write the value of any form field. The field's name will be the same as the 'name' attribute given to that field in your HTML. 

The PdfDocument.Form object can be used in two ways.

  • The first is to populate the default value of form fields, which must be focused in Adobe Reader to display this value.
  • The second is to read data from user-filled PDF forms in any language.

C# VB PDF .NET : Rasterize a PDF to Images Rasterize a PDF to Images
using IronPdf;
using System.Drawing;

//Example rendering PDF documents to Images or Thumbnails

var Pdf = PdfDocument.FromFile("Example.pdf");

//Extract all pages to a folder as image files
Pdf.RasterizeToImageFiles(@"C:\image\folder\*.png");

//Dimensions and page ranges may be specified
Pdf.RasterizeToImageFiles(@"C:\image\folder\thumbnail_*.jpg", 100, 80);


//Extract all pages as System.Drawing.Bitmap objects
System.Drawing.Bitmap[] pageImages = Pdf.ToBitmap();
Imports IronPdf
Imports System.Drawing

'Example rendering PDF documents to Images or Thumbnails

Private Pdf = PdfDocument.FromFile("Example.pdf")

'Extract all pages to a folder as image files
Pdf.RasterizeToImageFiles("C:\image\folder\*.png")

'Dimensions and page ranges may be specified
Pdf.RasterizeToImageFiles("C:\image\folder\thumbnail_*.jpg", 100, 80)


'Extract all pages as System.Drawing.Bitmap objects
Dim pageImages() As System.Drawing.Bitmap = Pdf.ToBitmap()

IronPDF allows any PDF document to be exported to image files in convenient formats or Bitmap objects.

Image dimensions and page number ranges may also be specified.

C# PDF to Images

Are you looking for the perfect solution to rasterize a PDF document into images? Look no further. 

When it comes to generating detailed images from PDF files, rasterization is the way to go. You get the best image results for use on different digital platforms without losing any quality. You can design an image with a broad range of colors and complications since you can adjust every single pixel. Raster graphic files are also compatible with the majority of photo editing software.

Now that we are agreed on that, you will need software built from the ground up with particular attention paid to the ability to rasterize PDF files or convert a PDF document to images, as well as other useful features. IronPDF is here to help. It is the PDF-to-image rasterizing solution you've been looking for, and much more besides.

Best Features of the IronPDF PDF-to-Images Rasterizing Solution

The IronPDF PDF-to-images rasterizing solution is the best in class feature-rich solution for converting your PDF files to raster images. Here are some of the features tailored to meet the needs of most PDF-to-image rasterization projects.

The IronPDF PDF pages to image rasterizing solution renders the PDF and exports image files in convenient formats such as JPEG Images, PNG images, BMP, or Bitmap. These image formats will be perfect for any circumstances you need, be it high-resolution prints, web publishing, etc. 

  1. One image file is created for each page, which makes the process less cumbersome and the resulting image files very easy to manage.

  2. You can specify the dimensions of the resulting image to one that is best suited to your current project.

  3. You can also specify particular PDF pages or the range of pages you wish to convert.

  4. The IronPDF PDF library is easy to install. You can begin converting PDF files right away.

  5. The IronPDF .NET library has quick and easy licensing options.

  6. IronPDF outshines most other PDF-to-Raster file solutions.

This is just one tool from the entire IronPDF suite. Carry on reading and we will show you the unlimited benefits available to you with IronPDF.

How to Rasterize a PDF Document to an Image File using IronPDF

With the IronPDF Library and rasterization tool, you can rasterize a PDF page from a PDF file format to a jpeg image using the RasterizeToImageFiles class. It is a simple copy-and-paste C# code that can run in any .NET library. Here is how to do it with the IronPDF suite:

  1. Specify the type of image file you want to output. The best guess will be taken from the FileNamePattern file extension if it is not specified.
  2. Next, specify the DPI or the desired resolution of the output images.
  3. Finally, IronPDF will output an array of the file paths of the image files created.
  4. It should be noted that the DPI will be ignored on Linux and macOS.
  5. The IronPDF Suite is not limited to PDF-to-Image rasterization. 

Leverage the Power of the BEST PDF Tool

PDF-to-image rasterization is just one of the tools in the IronPDF suite. The suite itself comes with an additional 50+ features, functionalities, and solutions that give IronPDF its unique abilities.

You may simply wish to read PDF file documents in C# .NET applications. If this is your aim, then use the PdfDocument.ExtractAllText method in the IronPDF library — it is as easy as can be. 

Extracting text from documents with whitespace is always a problem for many other PDF solutions. IronPDF is here to rectify such situations. Furthermore, multiple formatting, distorted image files, Unicode, and UTF-8 characters are in the past. The new system that IronPDF offers is rapidly winning over new clients. Enjoy the luxury of this seamless PDF tool.

Do you want to open and read password-protected PDF documents? You can do this easily in .NET programming languages such as Visual Basic, C#, etc. 

Simplicity of use: the IronPDF catchphrase  

One factor that motivated the development of IronPDF is "simplicity of use". The IronPDF suite cuts down the cumbersome work and unnecessary coding needed to manipulate PDF documents in a .NET environment. IronPDF cuts down the seemingly overwhelming processes and makes them unimaginably easier. This basic and intuitive platform allows a developer to use the text from a PDF file in the same way you would a text document. Moreover, you can also export the file to any operating system.

We can't overstate the simplicity, ease of use, and sheer potential this suite can help you achieve. Take your PDF manipulation to the next level with IronPDF.

Taking the Step Towards IronPDF

Considering the features that this PDF-solutions platform offers, you can't go wrong in deciding to try out IronPDF. Immediately after you sign up, you can begin reading, writing, and manipulating PDF files with any system and in any project. 

Using our software is just a few clicks away. Start by installing IronPDF, which is incredibly easy. Furthermore, there are incredibly helpful and detailed step-by-step guides on using our tools, a How-Tos, not to mention our resourceful support center that responds to queries as soon as possible (almost immediately).

Choose IronPDF today! It will be your first and most important step in learning how to read PDF files in C#.

You can also get the software for free by clicking on the following links:

DLL for Visual Studio (Visual Studio DLL)

Here is the page for the NuGet package.

IronPDF is available for development in any place and can be used in your project.

When you first launch IronPDF, you'll notice that it includes a wide range of features that make it super-easy to work with PDFs. You have complete freedom to research each class and function. To experience the best result of viewing the PDF document, you can construct a C# form example or several instances.

If any doubt is left in your mind, our 30-day free trial key is for you. It can help you explore the full potential of the IronPDF suite with no financial commitment. It can also help you decide which software license is right for you. If you are not sure, please do not hesitate to contact our team of experts, regardless of your location. 

You can download the software product from this link.

C# VB PDF .NET : Digitally Sign a PDF Digitally Sign a PDF
using IronPdf;

// Cryptographically sign an existing PDF in 1 line of code!
new IronPdf.Signing.PdfSignature("Iron.p12", "123456").SignPdfFile("any.pdf");


/***** Advanced example for more control *****/

// Step 1. Create a PDF
var Renderer = new IronPdf.ChromePdfRenderer();
var doc = Renderer.RenderHtmlAsPdf("<h1>Testing 2048 bit digital security</h1>");

// Step 2. Create a Signature.
// You may create a .pfx or .p12 PDF signing certificate using Adobe Acrobat Reader. 
// Read: https://helpx.adobe.com/acrobat/using/digital-ids.html

var signature = new IronPdf.Signing.PdfSignature("Iron.pfx", "123456");

// Step 3. Optional signing options and a handwritten signature graphic
signature.SigningContact = "support@ironsoftware.com";
signature.SigningLocation = "Chicago, USA";
signature.SigningReason = "To show how to sign a PDF";
signature.LoadSignatureImageFromFile("handwriting.png");

//Step 4. Sign the PDF with the PdfSignature. Multiple signing certificates may be used
doc.SignPdfWithDigitalSignature(signature);

//Step 4. The PDF is not signed until saved to file, steam or byte array.
doc.SaveAs("signed.pdf");
Imports IronPdf

' Cryptographically sign an existing PDF in 1 line of code!
Call (New IronPdf.Signing.PdfSignature("Iron.p12", "123456")).SignPdfFile("any.pdf")


'''*** Advanced example for more control ****

' Step 1. Create a PDF
Dim Renderer = New IronPdf.ChromePdfRenderer()
Dim doc = Renderer.RenderHtmlAsPdf("<h1>Testing 2048 bit digital security</h1>")

' Step 2. Create a Signature.
' You may create a .pfx or .p12 PDF signing certificate using Adobe Acrobat Reader. 
' Read: https://helpx.adobe.com/acrobat/using/digital-ids.html

Dim signature = New IronPdf.Signing.PdfSignature("Iron.pfx", "123456")

' Step 3. Optional signing options and a handwritten signature graphic
signature.SigningContact = "support@ironsoftware.com"
signature.SigningLocation = "Chicago, USA"
signature.SigningReason = "To show how to sign a PDF"
signature.LoadSignatureImageFromFile("handwriting.png")

'Step 4. Sign the PDF with the PdfSignature. Multiple signing certificates may be used
doc.SignPdfWithDigitalSignature(signature)

'Step 4. The PDF is not signed until saved to file, steam or byte array.
doc.SaveAs("signed.pdf")

IronPDF has options to digitally sign new or existing PDF files using .pfx and .p12 X509Certificate2 digital certificates.

Once a PDF is signed, it can not be modified without the certificate being invalidated. This ensures fidelity.

To generate a signing certificate for free using Adobe Reader, please read https://helpx.adobe.com/acrobat/using/digital-ids.html

In addition to cryptographic signing, a hand written signature image or company stamp image may also be used to sign using IronPDF.

You can download a file project from this link.

HTML to PDF in ASP .Net

What is IronPDF?

IronPDF is a .NET PDF library that enables programmers to easily create, edit, and export PDF files for .NET Core and .NET Framework in C#, F#, and VB.NET. IronPDF automates the creation of PDFs from prepared documents. Web forms, local HTML pages, and other web pages can all be converted to PDF using IronPDF. It can also create contracts, reports, quotes, invoices, and other paperwork as PDF reports/documents. It works with web forms, MVC, ASP.NET, ASP.NET Core, and Web APIs on the .NET Framework and .NET Core.

In addition to having a powerful, inbuilt HTML-to-PDF conversion engine (which can produce perfect PDF documents from HTML5, JavaScript, and CSS), IronPDF includes numerous PDF manipulation functions. Creating interactive PDF documents, filling out and submitting interactive forms, merging and splitting PDF files, extracting text and images from PDF files, searching text in PDF files, rasterizing PDF pages to images, and converting PDF files are all examples of activities that IronPDF can perform on PDF documents.

What is Blazor?

Blazor can execute client-side C# code directly in the browser by using WebAssembly. Since WebAssembly supports .NET technologies, Blazor can reuse source code and libraries from the backend in front-end applications developed with it. Blazor can also execute client-side business logic on the server. Using SignalR, a real-time messaging framework, client UI events are sent to the server. The necessary UI updates are transmitted to the client and incorporated into the DOM once execution is finished.

Using Blazor Hybrid, developers can create cross-platform, native client apps using .NET MAUI and existing Blazor UI components. Developers can also incorporate the same UI components across desktop, web, and mobile environments without losing access to the native features of either platform. Developers can also use Blazor Hybrid to update existing WPF and Windows Forms apps.

Blazor uses open web standards without relying on using plug-ins or code translation. All current web browsers, including those on mobile devices, support the Blazor server technology.

Get Started
.NET PDF Library Features Using IronPDF

How IronPDF works with Blazor

IronPDF for Blazor allows users to create, import, and export PDF documents using C# and VB.NET. The library also supports the .NET Framework, .NET Core, and .NET Standard. IronPDF provides two ways to edit a PDF: one that uses native PDF elements, and another that enables editing as a flow document.

Performance

The IronPDF library for Blazor provides unmatched performance and optimal memory consumption; it decodes photos as needed, compresses content using FlateDecode encryption, and embeds font subsets by containing only the most frequently used glyphs.

Interactive Forms

Use textboxes, radio buttons, list boxes, and other similar controls to add interactivity to PDF documents. In this way, users can update and fill out data in the PDF document as needed. Once the forms are complete, they can be flattened to remove the interactive fields while retaining their contents. This is useful in preventing subsequent alterations to the document.

Encryption

PDF documents can be encrypted with a password to safeguard confidential information from unauthorized access.

Text Properties

When producing or updating a PDF document, you can customize the appearance of textual and graphical elements thanks to a rich API. Stylistic controls, including fill, text, stroke, font, text size, and many more, can be used to effortlessly satisfy any design requirements.

Edit PDFs in C# VB .Net

How IronPDF Creates and Displays PDF Documents

IronPDF can convert webpages to PDFs with the help of the RenderHtmlAsPdf method. This method can accept a string containing a webpage’s HTML markup. In this way, the content can be styled inline as desired before being fed into the method. Additional code can enable users to receive the PDF file as a download to their client computer.

Similarly, the RenderUrlAsPdf method transforms the HTML content from a URL into PDF content, including any references to any JavaScript and CSS. IronPDF generates PDFs from HTML with high accuracy, ensuring 100% resemblance to the original web page. The library can handle complex web page designs containing charts, graphs, images, tables, etc., A separate method allows for accessory customizations on the PDF document. Possible customizations include changes to page sizes, margin sizes, header/footer content, etc.

Once a PDF document has been generated, client-side JavaScript can be used to display the document in the browser client.

HTML, JavaScript, CSS and Image Conversion to PDF in .NET Applications.

Why Blazor Supports IronPDF

IronPDF has been developed using the latest .NET technology, thereby allowing it to work within Blazor seamlessly without the need for complex integrations.

IronPDF supports many file types, including HTML, ASPX, cshtml, and Razor. Razor is a file format used in Blazor for embedding .NET source code into web pages. Its syntax consists of Razor markup, C#, and HTML.

Simple Installation <br/>for Visual Studio

Try It With NuGet Now

The benefits are clear! With IronPDF, you can do so much more, so much easier. Our product is perfect for anyone who needs to make, manage and edit a library of PDFs, including businesses in real estate, publishing, finance, and enterprise. The prices of our solution are also very competitive.

Ready to see what IronPDF can do for your projects and business? Try it out now

Install with Nuget for .Net Download Now
Supports:
  • Supports C#, VB in .NET Framework 4.0 and above
  • Nuget Installer Support for Visual Studio
  • .Net Core 2 and above
  • .Net Development IDE - Microsoft Visual Studio.
  • Azure for .NET cloud hosting
  • JetBrains ReSharper C# compatible

IronPDF Licensing

Free for development purposes. Deployment licenses from $749.

Project C# + VB.NET Library Licensing

Project

Organization C# + VB.NET Library Licensing

Organization

SaaS C# + VB.NET Library Licensing

SaaS

OEM C# + VB.NET Library Licensing

OEM

Developer C# + VB.NET Library Licensing

Developer

Agency C# + VB.NET Library Licensing

Agency

Licensing IronPDF for Deployment  

PDF C# / VB Tutorials for .Net

C# HTML-to-PDF | C Sharp & VB.Net Tutorial

C# PDF HTML

Jean Ashberg .NET Software Engineer

Tutorial | CSharp and VB .NET HTML to PDF

Let's create PDFs in .Net, without the need for complex programtic design layout or APIs…

View Jean's HTML To PDF Tutorial
ASPX to PDF | ASP.NET Tutorial

C# PDF .NET ASPX

Jacob Müller Software Product Designer @ Team Iron

Tutorial | ASPX to PDF in ASP.NET

See how easy it is to convert ASPX pages into PDF documents using C# or VB .Net…

See Jacob's ASPX To PDF Tutorial
VB.Net | VB .NET PDF Tutorial

VB.NET PDF ASP.NET

Veronica Sillar .NET Software Engineer

Tutorial | Create PDFs with VB.Net

See how I use IronPDF to create PDF documents within my VB .NET projects…

See Veronica's VB .NET Tutorial
Thousands of developers use IronPDF for...

Accounting and Finance Systems

  • # Receipts
  • # Reporting
  • # Invoice Printing
Add PDF Support to ASP.Net Accounting and Finance Systems

Business Digitization

  • # Documentation
  • # Ordering & Labelling
  • # Paper Replacement
C# Business Digitization Use Cases

Enterprise Content Management

  • # Content Production
  • # Document Management
  • # Content Distribution
.Net CMS PDF Support

Data and Reporting Applications

  • # Performance Tracking
  • # Trend Mapping
  • # Reports
C# PDF Reports
Install IronPDF Now
IronPDF Component software library customers

Developers working within Companies, Government departments and as freelancers use IronPDF.

IronPDF is constantly supported as a leading .NET PDF Library

IronPDF Customer Icon
IronPDF Customer Icon
IronPDF Customer Icon
IronPDF Customer Icon
IronPDF Customer Icon
IronPDF Customer Icon
IronPDF Customer Icon
IronPDF Customer Icon