HtmlRendererCore.PdfSharpMigraDoc 2.0.12

dotnet add package HtmlRendererCore.PdfSharpMigraDoc --version 2.0.12
                    
NuGet\Install-Package HtmlRendererCore.PdfSharpMigraDoc -Version 2.0.12
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="HtmlRendererCore.PdfSharpMigraDoc" Version="2.0.12" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="HtmlRendererCore.PdfSharpMigraDoc" Version="2.0.12" />
                    
Directory.Packages.props
<PackageReference Include="HtmlRendererCore.PdfSharpMigraDoc" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add HtmlRendererCore.PdfSharpMigraDoc --version 2.0.12
                    
#r "nuget: HtmlRendererCore.PdfSharpMigraDoc, 2.0.12"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package HtmlRendererCore.PdfSharpMigraDoc@2.0.12
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=HtmlRendererCore.PdfSharpMigraDoc&version=2.0.12
                    
Install as a Cake Addin
#tool nuget:?package=HtmlRendererCore.PdfSharpMigraDoc&version=2.0.12
                    
Install as a Cake Tool

HtmlRendererCore

NuGet version (HtmlRendererCore.PdfSharpMigraDoc) Build

HtmlRendererCore is a partial port of HtmlRendererCore for .NET 6+ by https://github.com/manuel3108/HtmlRendererCore-Net7 Previous versions of this library used System.Drawing which was deprecated for linux systems in .Net 6, and completely remove in .Net 7.

This package does library updates to latest and targets .NET 8 and uses PdfSharpMigraDoc package instead of PdfSharp

This library offers Html to Pdf parsing for .Net Core projects using PdfSharpCore.

Future updates will be focused at cleaning up the codebase and offering support for more advanced HTML rendering. Public pull requests welcome.

Example usage

Generate PDF from HTML

var pdf = PdfGenerator.GeneratePdf(html, PdfSharpCore.PageSize.A4);

Generating Base64 PDF from HTML

var result = string.Empty;

using (var stream = new MemoryStream())
{
    var pdf = PdfGenerator.GeneratePdf(html, PdfSharpCore.PageSize.A4);

    pdf.Save(stream);

    result = Convert.ToBase64String(stream.ToArray());
}

Publishing

  • dotnet build -c Release
  • dotnet pack -c Release ./HtmlRendererCore.PdfSharpMigraDoc/HtmlRendererCore.PdfSharpMigraDoc.csproj -o .
  • dotnet publish
  • dotnet nuget push "HtmlRendererCore.PdfSharpMigraDoc.2.0.12.nupkg" -k ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json

Attribution

HtmlRendererCore: https://github.com/j-petty/HtmlRendererCore HtmlRendererCore port to .NET 7: https://github.com/manuel3108/HtmlRendererCore-Net7 PdfSharp: https://github.com/empira/PDFsharp/

License

Copyright (c) 2021 James Petty

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.12 487 7/16/2025
2.0.11 305 2/12/2025