Create PDF files in Blazor

submited by
Style Pass
2023-03-15 15:30:04

The PDF service client will make a HTTP call to the API service, This way you can bypass the typical problems that arise when attempting to install and operate PDF tools on a server. And you can deploy your code on Windows or Linux machines without any concerns about dealing with diverse environments.

Configuration is done by code in the Program.cs file, by adding a call to the AddRotativaIo services extension method and adding routing for controllers:

You should replace placeholders with the values you will find in your account preferences page. You can register for one at the Singup page (free account is available).

You will need to add an MVC controller to your project and add using Rotativaio.AspNetCore; to reference the client:

You’ll need to add a razor view file (.cshtml) for each PDF you’ll need to produce. It will work exactly like regular MVC apps.

Leave a Comment