Async PDF Generation
using IronPdf;

// Instantiate Renderer
var renderer = new ChromePdfRenderer();

// All IronPdf Rendering methods have Async equivalents
var pdf = await renderer.RenderHtmlAsPdfAsync("<h1>Html with CSS and Images</h1>");

// Export to a file or Stream
pdf.SaveAs("async_example.pdf");
NuGet Download
PM > Install-Package IronPdf
Async PDF Generation

Async PDF Generation

IronPDF supports asynchronous PDF generation, allowing for optimized performance and efficiency in PDF generation tasks. By using the await keyword along with IronPDF's RenderHtmlAsPdfAsync method, you can efficiently create PDF documents without hurting your system's performance.

Steps to Asynchronous PDF Generation

To begin, we create a new ChromePdfRenderer instance, utilizing IronPDF's powerful rendering engine to generate pixel-perfect PDF documents. Once this is done, we have access to the method we need to generate a PDF document from the given HTML string. At this stage, we use the await keyword to pause the execution of our async method until the PDF generation is complete. The RenderHtmlAsPdfAsync method takes the HTML input and renders it into a PDF asynchronously, improving performance by avoiding blocking operations.

The final step is to save the generated PDF document to a specified file name and location using the SaveAs method. Beyond this basic example, IronPDF's asynchronous PDF generation methods can be used in situations such as generating large batches of PDF documents in a more performance-friendly manner.

Explore Asynchronous PDF Generation with IronPDF
View on GitHub

Ready to Get Started?

Nuget Downloads 21,739,885Version:2026.10just released