IronPdf.Extensions.Blazor
2024.5.2
Prefix Reserved
dotnet add package IronPdf.Extensions.Blazor --version 2024.5.2
NuGet\Install-Package IronPdf.Extensions.Blazor -Version 2024.5.2
<PackageReference Include="IronPdf.Extensions.Blazor" Version="2024.5.2" />
paket add IronPdf.Extensions.Blazor --version 2024.5.2
#r "nuget: IronPdf.Extensions.Blazor, 2024.5.2"
// Install IronPdf.Extensions.Blazor as a Cake Addin #addin nuget:?package=IronPdf.Extensions.Blazor&version=2024.5.2 // Install IronPdf.Extensions.Blazor as a Cake Tool #tool nuget:?package=IronPdf.Extensions.Blazor&version=2024.5.2
IronPdf Extensions Package for Blazor Server App
Compatibility
Supports web applications and websites developed in Blazor Server App using .NET Core.
- .NET 8
- .NET 7
- .NET 6
- .NET 5
The IronPDF Blazor Server App extension provides utility methods, such as RenderRazorComponentToPdf
, to convert Razor Components into PDF documents in a Blazor Server project. The main IronPdf package is still required to achieve this.
Please visit "How to Convert Razor to PDF in Blazor Server" for a comprehensive guide on how to use the package.
C# Code Example
@using IronPdf;
@using IronPdf.Extensions.Blazor;
@code {
[Parameter]
public IEnumerable<PersonInfo> persons { get; set; }
public Dictionary<string, object> Parameters { get; set; } = new Dictionary<string, object>();
protected override async Task OnInitializedAsync()
{
persons = new List<PersonInfo>
{
new PersonInfo { Name = "Alice", Title = "Mrs.", Description = "Software Engineer" },
new PersonInfo { Name = "Bob", Title = "Mr.", Description = "Software Engineer" },
new PersonInfo { Name = "Charlie", Title = "Mr.", Description = "Software Engineer" }
};
}
private async void PrintToPdf()
{
ChromePdfRenderer renderer = new ChromePdfRenderer();
// Apply text footer
renderer.RenderingOptions.TextFooter = new TextHeaderFooter()
{
LeftText = "{date} - {time}",
DrawDividerLine = true,
RightText = "Page {page} of {total-pages}",
Font = IronSoftware.Drawing.FontTypes.Arial,
FontSize = 11
};
Parameters.Add("persons", persons);
// Render razor component to PDF
PdfDocument pdf = renderer.RenderRazorComponentToPdf<Person>(Parameters);
File.WriteAllBytes("razorComponentToPdf.pdf", pdf.BinaryData);
}
}
Note: This package installs only as an extension, and you also need to install the IronPDF package to use it in your application.
Documentation
- Code Samples : https://ironpdf.com/examples/razor-to-pdf-blazor-server/
- How-to : https://ironpdf.com/how-to/razor-to-pdf-blazor-server/
- MSDN Class Reference : https://ironpdf.com/c%23-pdf-documentation/
- Licensing : https://ironpdf.com/licensing/
- Live Chat Support : https://ironpdf.com/#helpscout-support
For more support and inquiries, please email us at: support@ironsoftware.com
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
* Minor Bug Fixes