IRONSOFTWAREHOME

Try IronPDF’s .NET PDF Library

C# VB PDF .NET : Generating PDFs in BlazorGenerating 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)
    {
    }
}
NuGet Downloads Badge
PM >
Install-Package IronPdf

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 HTML to PDF conversion process also allows PDF design to be delegated to web designers, rather than being 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.

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.

.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 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

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 $999.

Licensing IronPDF for Deployment

PDF C# / VB Tutorials for .NET

C# HTML-to-PDF | C Sharp & VB.NET Tutorial
C#PDFHTML
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.NETASPX
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.NETPDFASP.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
.NET Coders

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

Ready to Get Started?

Nuget Downloads 20,389,208Version:2026.8just released

Key in blue circle

Get your free 30-day Trial Key instantly.

bullet_checkedNo credit card or account creation required
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Book your free Live Demo
Booking Badge related to IronPDF Product Demo

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required