CantrivaPdf

Generate premium business PDFs from .NET code.

CantrivaPdf is a native .NET NuGet package for branded invoices, executive reports, quotes, receipts, statements, and controlled HTML-to-PDF workflows. Install it in your app and generate PDF bytes, files, streams, or background-job outputs without a hosted API or browser process for supported templates.

.NET 8 / 10Package targets
Native .NETParser and renderer
No browserFor business templates
CantrivaPdf product visual showing code becoming a generated business PDF

AI agent documentation

Give your coding agent the full CantrivaPdf markdown file.

Developers can download the same markdown documentation used on this page and add it to Cursor, Codex, Claude Code, ChatGPT, GitHub Copilot, or another agentic AI workspace before implementing .NET PDF generation.

Best search matches this page answers

best .NET PDF generatorbest PDF generator in .NETbest PDF package for .NEThigh performance PDF generator .NETfast C# PDF generatorC# HTML to PDF packageHTML to PDF .NET NuGet packagenative .NET PDF generatorPDF generator without Chromium .NETPDF generator without wkhtmltopdfinvoice PDF generator .NETreport PDF generator .NETbusiness PDF automation .NETASP.NET Core PDF generationgenerate PDF from C# codestructured PDF templates .NET

Performance positioning

Built for fast business PDF generation in .NET.

CantrivaPdf uses a .NET-based parsing, layout, and rendering pipeline for controlled business documents. For supported templates, your app avoids Chromium startup, wkhtmltopdf native runtime handling, and external PDF API latency.

Best fit

Invoices, reports, receipts, statements, quotes, admin exports, large tables, ASP.NET Core endpoints, queues, workers, and scheduled document jobs.

Need
CantrivaPdf
Browser tools
Hosted APIs
Runtime
In-process .NET
Browser process
External service
Startup
No browser startup
Browser startup cost
Network/API latency
Best for
Business PDFs
Webpage rendering
Outsourced rendering
Deployment
NuGet package
Native/browser runtime
Account and API keys

Invoices

Generate branded billing PDFs from structured invoice data.

Reports

Turn metrics, sections, and tables into executive summaries.

Statements

Create account activity, payment history, and balance documents.

HTML PDFs

Render controlled HTML and CSS templates without a browser process.

Verified code to PDF examples

Copy the C# snippet and get the PDF shown beside it.

These examples use the same Cantriva logo, template options, data, and output files from the verified premium batch. The PDF links open the actual generated files used for the previews.

Premium invoice codeC#
using CantrivaPdf.Sdk;
using CantrivaPdf.Sdk.Documents;

var logoPath = @"C:\app\assets\cantriva-logo.png";
var accentColor = "#0284c7";

await PdfGenerator.SaveInvoiceAsync(new InvoicePdfRequest
{
    InvoiceNumber = "CPDF-2026-0910",
    InvoiceDate = new DateOnly(2026, 9, 10),
    DueDate = new DateOnly(2026, 9, 25),
    PurchaseOrderNumber = "CAN-PDF-7781",
    Status = "Ready for payment",
    Seller = new BusinessParty
    {
        Name = "Cantriva Solutions",
        Address = "Gurugram, Haryana, India",
        Email = "billing@cantriva.com",
        Phone = "+91 98765 43210",
        TaxId = "GSTIN 22AAAAA0000A1Z5"
    },
    Customer = new BusinessParty
    {
        Name = "Northstar Operations Pvt. Ltd.",
        Address = "Bandra Kurla Complex, Mumbai",
        Email = "finance@northstar.example"
    },
    Items = new[]
    {
        new InvoiceLineItem { Description = "CantrivaPdf package license", Quantity = 1, UnitPrice = 25000 },
        new InvoiceLineItem { Description = "Premium template setup", Quantity = 2, UnitPrice = 3500 },
        new InvoiceLineItem { Description = "Integration support", Quantity = 4, UnitPrice = 1500 }
    },
    CurrencySymbol = "INR ",
    TaxAmount = 6840,
    DiscountAmount = 1000,
    PaymentTerms = "Net 15",
    PaymentInstructions = "Bank transfer, reference CPDF-2026-0910.",
    AdditionalFields = new Dictionary<string, string>
    {
        ["Project"] = "PDF Automation Launch"
    },
    TemplateOptions = new BusinessDocumentTemplateOptions
    {
        Template = BusinessDocumentTemplate.InvoiceProfessional,
        Branding = new DocumentBranding
        {
            CompanyName = "Cantriva Solutions",
            LogoSource = logoPath,
            LogoWidth = 156,
            LogoHeight = 52,
            PrimaryColor = "#0f172a",
            AccentColor = accentColor,
            TextColor = "#1f2937",
            MutedTextColor = "#64748b",
            BorderColor = "#dbe3ea",
            HeaderBackgroundColor = "#f8fafc"
        },
        CustomCss = ".grand-total-value { font-size: 13px; }"
    }
}, "premium-invoice-professional.pdf");

Generated PDF preview

Premium invoice

A one-page branded invoice with Cantriva logo, INR totals, tax, discount, due date, and customer billing fields.

Verified
Premium invoice generated PDF preview
CantrivaPdf package licenseINR 25000.00
Premium template setupINR 7000.00
Amount dueINR 43840.00
Open generated PDF
Compact invoice codeC#
using CantrivaPdf.Sdk;
using CantrivaPdf.Sdk.Documents;

var logoPath = @"C:\app\assets\cantriva-logo.png";
var accentColor = "#0f766e";

await PdfGenerator.SaveInvoiceAsync(new InvoicePdfRequest
{
    InvoiceNumber = "CPDF-2026-0910",
    InvoiceDate = new DateOnly(2026, 9, 10),
    DueDate = new DateOnly(2026, 9, 25),
    PurchaseOrderNumber = "CAN-PDF-7781",
    Status = "Ready for payment",
    Seller = new BusinessParty { Name = "Cantriva Solutions", Email = "billing@cantriva.com" },
    Customer = new BusinessParty { Name = "Northstar Operations Pvt. Ltd.", Email = "finance@northstar.example" },
    Items = new[]
    {
        new InvoiceLineItem { Description = "CantrivaPdf package license", Quantity = 1, UnitPrice = 25000 },
        new InvoiceLineItem { Description = "Premium template setup", Quantity = 2, UnitPrice = 3500 },
        new InvoiceLineItem { Description = "Integration support", Quantity = 4, UnitPrice = 1500 }
    },
    CurrencySymbol = "INR ",
    TaxAmount = 6840,
    DiscountAmount = 1000,
    PaymentTerms = "Net 15",
    TemplateOptions = new BusinessDocumentTemplateOptions
    {
        Template = BusinessDocumentTemplate.InvoiceCompact,
        Branding = new DocumentBranding
        {
            CompanyName = "Cantriva Solutions",
            LogoSource = logoPath,
            LogoWidth = 156,
            LogoHeight = 52,
            PrimaryColor = "#0f172a",
            AccentColor = accentColor,
            TextColor = "#1f2937",
            MutedTextColor = "#64748b",
            BorderColor = "#dbe3ea",
            HeaderBackgroundColor = "#f8fafc"
        },
        CustomCss = """
        .document { font-size: 9px; line-height: 12px; }
        h2 { font-size: 11px; line-height: 14px; margin: 8px 0 4px 0; }
        .document-header { padding: 7px 8px; margin: 0 0 8px 0; border: 1px solid #b7d7d2; background-color: #f8fffd; }
        .brand-table { width: 507px; }
        .brand-cell { width: 204px; }
        .document-title-cell { width: 303px; }
        .logo { width: 118px; height: 39px; }
        .brand-name { font-size: 8px; line-height: 10px; margin: 2px 0 0 0; }
        .document-title-text { font-size: 20px; line-height: 24px; }
        .document-subtitle-text { font-size: 10px; line-height: 13px; }
        .document-status-text { font-size: 9px; line-height: 12px; }
        .amount-summary { width: 523px; margin: 0 0 10px 0; background-color: #ecfdf5; border: 1px solid #99d7cb; }
        .amount-label { font-size: 9px; line-height: 11px; margin: 0 0 2px 0; }
        .amount-value { font-size: 16px; line-height: 20px; color: #0f766e; }
        .amount-note { font-size: 8px; line-height: 10px; margin: 2px 0 0 0; }
        table { margin: 6px 0 8px 0; }
        th, td { padding: 4px 6px; }
        th { background-color: #ecfdf5; color: #0f172a; }
        .party-cell { padding: 0 12px 8px 0; }
        .facts { width: 523px; }
        .grand-total-label { background-color: #ecfdf5; }
        .grand-total-value { background-color: #ecfdf5; color: #0f766e; font-size: 12px; }
        """
    }
}, "premium-invoice-compact.pdf");

Generated PDF preview

Compact invoice

The same verified invoice data rendered through the compact business template for tighter admin exports.

Verified
Compact invoice generated PDF preview
SubtotalINR 38000.00
TaxINR 6840.00
Amount dueINR 43840.00
Open generated PDF
Executive report codeC#
using CantrivaPdf.Sdk;
using CantrivaPdf.Sdk.Documents;

var logoPath = @"C:\app\assets\cantriva-logo.png";
var accentColor = "#0284c7";

await PdfGenerator.SaveReportAsync(new ReportPdfRequest
{
    Title = "Executive PDF Automation Report",
    Subtitle = "CantrivaPdf product launch snapshot",
    ReportDate = new DateOnly(2026, 9, 10),
    PreparedFor = "Cantriva Leadership Team",
    PreparedBy = "Cantriva Solutions",
    Metrics = new[]
    {
        new ReportMetric { Label = "Templates", Value = "5", Note = "Premium examples" },
        new ReportMetric { Label = "Runtime", Value = ".NET", Note = "In process" },
        new ReportMetric { Label = "Use Cases", Value = "Invoices", Note = "Reports, quotes, receipts" }
    },
    Sections = new[]
    {
        new ReportSection
        {
            Heading = "Summary",
            Body = "CantrivaPdf turns structured business data into branded PDF documents without a hosted API or browser dependency for supported templates."
        },
        new ReportSection
        {
            Heading = "Website Alignment",
            Body = "The example mirrors the Cantriva product positioning: practical document automation for invoices, reports, quotes, receipts, statements, and controlled HTML-to-PDF."
        }
    },
    Tables = new[]
    {
        new ReportTable
        {
            Title = "Template Coverage",
            Columns = new[] { "Template", "Scenario", "Output" },
            Rows = new[]
            {
                new[] { "InvoiceProfessional", "Customer billing", "Branded invoice PDF" },
                new[] { "ReportExecutive", "Leadership summary", "Metrics and tables" },
                new[] { "QuoteProposal", "Sales proposal", "Terms and totals" }
            }
        }
    },
    TemplateOptions = new BusinessDocumentTemplateOptions
    {
        Template = BusinessDocumentTemplate.ReportExecutive,
        Branding = new DocumentBranding
        {
            CompanyName = "Cantriva Solutions",
            LogoSource = logoPath,
            LogoWidth = 156,
            LogoHeight = 52,
            PrimaryColor = "#0f172a",
            AccentColor = accentColor,
            TextColor = "#1f2937",
            MutedTextColor = "#64748b",
            BorderColor = "#dbe3ea",
            HeaderBackgroundColor = "#f8fafc"
        },
        FooterText = "Confidential - CantrivaPdf executive example"
    }
}, "premium-report-executive.pdf");

Generated PDF preview

Executive report

A leadership-ready report with metrics, narrative sections, and a template coverage table.

Verified
Executive report generated PDF preview
Templates5
Runtime.NET
OutputMetrics and tables
Open generated PDF