I am trying to use NReco.PdfGenerator 1.2.0 on a C# batch job developed in .net core 3.1 but it doesn't work and I am getting the following warning:
Severity Code Description Project File Line Suppression State Warning NU1701 Package 'NReco.PdfGenerator 1.2.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v3.1'. This package may not be fully compatible with your project
Is there an equivalent package that will allow me to convert HTML to PDF in a .net core 3.1 batch job?
CodePudding user response:
For historic reasons "NReco.PdfGenerator" nuget package includes wkhtmltopdf binaries (for Windows) and can be used only in classic .NET Framework projects.
.NET Core / NET5 apps can target different (non-Windows) OS environments, therefore another nuget "NReco.PdfGenerator.LT" should be used; LT-build does NOT include wkhtmltopdf binaries and it expects that wkhtmltopdf is deployed separately (in an appropriate way for the concrete OS). Note that LT nuget doesn't suppose free usage and requires a key (you can request a demo key for testing purposes, as stated on the component page).