Skip to content
DemoSampleAPI ReferenceFAQ

PDF Generation Template Editor

Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.

View on GitHub

Overview ​

ComPDF Generation for .NET Core is a powerful PDF generation library that provides multiple ways to generate high-quality PDF documents. Whether through HTML conversion or direct code construction, it can meet your various PDF generation needs.

ComPDF Generation SDK ​

ComPDF Generation for .NET Core is cross-platform, supporting Windows, Linux, and macOS.

Key Features ​

The PDF Generation component provides the following features:

Generate PDF from HTML ​

  • HTML to PDF: Supports converting HTML strings, files, or streams to PDF documents.
  • Template Rendering: Supports dynamically filling HTML templates using JSON data and rendering them into PDF documents.
  • Custom Configuration: Allows setting parameters such as page size, page margins, base URI, and fonts.
  • Headers and Footers: Supports adding independent HTML header and footer templates to every page, with page numbers, total pages, title, date and more filled in automatically, and can skip the cover page.
  • Font Management: Supports custom fonts and can integrate system fonts.

Generate PDF from Email (EML/MSG) ​

  • Email Formats: Supports EML (RFC 5322 / MIME) and Outlook MSG emails, with automatic format detection.
  • Email to HTML: Converts emails to offline HTML, and can export body resources such as images and attachments.
  • Email to PDF: Generates PDFs with the email headers, body and attachment list, with custom page size, page margins, and headers and footers.
  • Content Access: Reads the body HTML, resources, attachment bytes and conversion diagnostics.

Generate PDF Using Layout API ​

  • Programmatic Document Construction: Directly create and control every element of PDF documents through code.
  • Rich Element Types: Supports text, paragraphs, tables, lists, images, separators, and various other elements.
  • Flexible Layout Control: Supports block-level elements, inline elements, and absolute positioning, providing precise layout control.
  • Complete Style System: Supports reusable styles, box model (margin, padding, border), background, fonts, etc.
  • Flowing Layout: Automatically handles pagination and content reflow, supports table headers and footers repeating across multiple pages.
  • Tree-Structured Document: Adopts an intuitive hierarchical structure to organize document content, easy to understand and maintain.

The Layout API is particularly suitable for scenarios that require precise control of document layout, dynamic generation of complex structured documents, or deep integration with existing code logic.