Razor to PDF (Blazor Server) This example demonstrates how a Razor component can be converted into a PDF document. The IronPdf.Extensions.Blazor package is an extension of the main IronPdf package. To convert a Razor component's content page to a PDF, both the IronPdf.Extensions.Blazor and the primary IronPdf packages are required. In the code example below, a model called PersonInfo has already been created. In the OnInitializedAsync method, we insert multiple new PersonInfo objects into the persons List. We then associate the persons List with the string "persons" in the Parameters dictionary. In the PrintToPdf method, we instantiate the ChromePdfRenderer class. To convert the Razor component to a PDF document, we use the RenderRazorComponentToPdf method. In the code example, we pass the Parameters dictionary to the method for rendering. How to Convert Razor Components to PDFs in Blazor Server Install IronPDF from NuGet for Razor component conversion in C# Prepare a model to store the information Instantiate the ChromePdfRenderer class Pass the Dictionary object containing the data to the RenderRazorComponentToPdfAsync method Download the resulting PDF document to the desktop Learn to Convert Razor Components to PDF in Blazor Server View on GitHub Code https://github.com/iron-software/IronPdf.Examples/tree/main/examples/razor-to-pdf-blazor-server Download ZIP Related Tutorial Related How-To Guide Class Documentation Get Language Packs Download IronPDF DLL Report an Issue on this page Ready to Get Started? Nuget Downloads 16,425,128 | Version: 2025.11 just released Free NuGet Download Total downloads: 16,425,128 View Licenses
All your questions are answered to make sure you have all the information you need. (No commitment whatsoever.)