HtmlRendererCore: HTML to PDF Rendering for .NET Core

This repository profile is provided by osrepos.com, an open source repository discovery platform.

HtmlRendererCore: HTML to PDF Rendering for .NET Core

Summary

HtmlRendererCore is a partial port of the popular HtmlRenderer library, specifically designed to bring robust HTML to PDF conversion capabilities to .NET Core projects. It leverages PdfSharpCore to enable developers to easily generate PDF documents from HTML content, making it a valuable tool for various application needs.

Repository Information

Analyzed by OSRepos on October 12, 2025

Topics

Click on any tag to explore related repositories

Use at your own risk

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.

Introduction

HtmlRendererCore is an essential library for .NET Core developers needing to convert HTML content into PDF documents. As a partial port of the well-known HtmlRenderer, it extends its powerful rendering capabilities to the modern .NET Core ecosystem. This project integrates seamlessly with PdfSharpCore, providing a straightforward solution for generating high-quality PDFs directly from HTML strings.

Installation

HtmlRendererCore is available as a NuGet package, making it easy to integrate into your .NET Core projects. You can add it using the NuGet Package Manager or via the .NET CLI:

dotnet add package HtmlRendererCore.PdfSharp

This package includes the necessary components for HTML to PDF conversion using PdfSharpCore.

Examples

The library provides simple and intuitive methods for generating PDFs. Here are a couple of common use cases:

Generate PDF from HTML

To convert an HTML string into a PDF document, you can use the PdfGenerator class:

var pdf = PdfGenerator.GeneratePdf(html, PdfSharpCore.PageSize.A4);
// 'pdf' is now a PdfDocument object that can be saved or manipulated.

Generating Base64 PDF from HTML

For scenarios where you need the PDF content as a Base64 encoded string, such as for API responses or embedding, you can do the following:

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());
}
// 'result' now contains the Base64 encoded PDF string.

Why Use It?

HtmlRendererCore fills a crucial gap for .NET Core developers by offering a reliable and efficient way to convert HTML to PDF. Its benefits include:

  • .NET Core Compatibility: Specifically designed for the modern .NET Core framework.
  • Ease of Use: Simple API for quick integration and PDF generation.
  • Leverages PdfSharpCore: Builds upon a robust and widely used PDF library.
  • Open Source: Actively maintained and open to community contributions, ensuring flexibility and transparency.
  • Versatile: Suitable for various applications, from generating reports and invoices to dynamic content archiving.

Links

Related repositories

Similar repositories that may be relevant next.

dotnet/skills: Curated .NET Agent Skills for AI Coding Agents

dotnet/skills: Curated .NET Agent Skills for AI Coding Agents

May 24, 2026

The dotnet/skills repository provides a curated collection of core skills and custom agents designed to assist AI coding agents with .NET and C# development. It offers a comprehensive set of plugins covering various aspects of the .NET ecosystem, from data access and diagnostics to AI integration and project upgrades. This resource empowers developers to enhance their AI-driven coding workflows with specialized .NET capabilities.

agent-skillsC#.NET
Radarr: Your Ultimate Movie Organizer for Usenet and Torrent Users

Radarr: Your Ultimate Movie Organizer for Usenet and Torrent Users

May 1, 2026

Radarr is a powerful movie collection manager designed for Usenet and BitTorrent users. It automates the process of monitoring, grabbing, sorting, and renaming movies, ensuring your library is always organized and up-to-date. With support for various download clients and media servers, Radarr streamlines your movie management workflow.

moviemoviesmedia management
KurrentDB: An Event-Native Database for Modern Event-Driven Architectures

KurrentDB: An Event-Native Database for Modern Event-Driven Architectures

April 19, 2026

KurrentDB is an innovative database designed for modern software and event-driven architectures. Its event-native approach simplifies data modeling and ensures data integrity, while an integrated streaming engine addresses distributed messaging and data consistency challenges. This powerful platform, formerly known as EventStoreDB, provides a robust solution for complex data management.

databaseevent-sourcingevent-store
Harden-Windows-Security: Enhance Your Windows System Security with Official Methods

Harden-Windows-Security: Enhance Your Windows System Security with Official Methods

December 2, 2025

The Harden-Windows-Security repository by HotCakeX provides robust tools and guides to secure Windows using official Microsoft methods. It offers two key applications, Harden System Security and AppControl Manager, available on the Microsoft Store, catering to personal, enterprise, and military security needs. The project emphasizes defense-in-depth and adheres to SLSA Level 3 compliance for secure development.

Windows SecurityCybersecuritySystem Hardening

Source repository

Open the original repository on GitHub.

8 counted GitHub visits

View on GitHub
OS
OSRepos

Analysis and discovery of open source repositories. Find interesting projects and follow their updates.

Monitor your website with YourWebsiteScore

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of third-party repository code is at your own risk. Always review source code, dependencies, licenses, and security implications before running anything.

© 2025 OSRepos. Built with Nuxt 3 and lots of ❤️