Creating PDF files in Asp.Net Core is really easy with the Rotativa.io Asp.Net Core client.
You will avoid all possible issues that often arise whem trying to install and run PDF tools on a server since all your code will do is make a HTTP call to a the Rotativa.io API service. You can then deploy on Windows or Linux machines without having to worry about the different environments.
Installation is easy. You need to add the
Rotativaio.AspNetCore package to you project.
PM> Install-Package Rotativaio.AspNetCore
> dotnet add package Rotativaio.AspNetCore
It will work with Asp.net Core 3.1 and up to Asp.Net Core 6.
Configuration is done by code in the Startup.cs file, by adding a call to the
AddRotativaIo services extension method:
You should replace placeholders with the values you will find in your account preferences page. You can register for one at the Rotativa.io Singup page (free account is available).
Creating PDF docs from your views will exactly the same as in Rotativa: