Invoices
Generate branded billing PDFs from structured invoice data.
CantrivaPdf
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.

AI agent documentation
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
Performance positioning
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.
Generate branded billing PDFs from structured invoice data.
Turn metrics, sections, and tables into executive summaries.
Create account activity, payment history, and balance documents.
Render controlled HTML and CSS templates without a browser process.
Verified code to PDF examples
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.
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
A one-page branded invoice with Cantriva logo, INR totals, tax, discount, due date, and customer billing fields.

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
The same verified invoice data rendered through the compact business template for tighter admin exports.

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
A leadership-ready report with metrics, narrative sections, and a template coverage table.

Developer template gallery
These templates show practical business document shapes developers can adapt with structured APIs or controlled HTML, while keeping CantrivaPdf focused and predictable.
A one-page branded invoice with Cantriva logo, INR totals, tax, discount, due date, and customer billing fields.
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");The same verified invoice data rendered through the compact business template for tighter admin exports.
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");A leadership-ready report with metrics, narrative sections, and a template coverage table.
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");A sales proposal PDF with validity date, terms, subtotal, tax, discount, and final quote total.
using CantrivaPdf.Sdk;
using CantrivaPdf.Sdk.Documents;
var logoPath = @"C:\app\assets\cantriva-logo.png";
var accentColor = "#0ea5e9";
await PdfGenerator.SaveQuoteAsync(new QuotePdfRequest
{
QuoteNumber = "Q-CPDF-2401",
QuoteDate = new DateOnly(2026, 9, 10),
ValidUntil = new DateOnly(2026, 10, 10),
Status = "Proposal",
Seller = new BusinessParty { Name = "Cantriva Solutions" },
Customer = new BusinessParty { Name = "Enterprise Buyer", Email = "buyer@example.com" },
Items = new[]
{
new QuoteLineItem { Description = "CantrivaPdf enterprise template package", Quantity = 1, UnitPrice = 50000 },
new QuoteLineItem { Description = "Implementation and rollout support", Quantity = 8, UnitPrice = 2500 }
},
CurrencySymbol = "INR ",
TaxAmount = 12600,
DiscountAmount = 2500,
Terms = "Quote is valid for 30 days and covers controlled business templates shown on the Cantriva product website.",
TemplateOptions = new BusinessDocumentTemplateOptions
{
Template = BusinessDocumentTemplate.QuoteProposal,
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 = "Cantriva Solutions | sales@cantriva.com"
}
}, "premium-quote-proposal.pdf");A branded payment receipt for invoice payment confirmations and transaction records.
using CantrivaPdf.Sdk;
using CantrivaPdf.Sdk.Documents;
var logoPath = @"C:\app\assets\cantriva-logo.png";
var accentColor = "#06b6d4";
await PdfGenerator.SaveReceiptAsync(new ReceiptPdfRequest
{
ReceiptNumber = "RCPT-CPDF-1001",
ReceiptDate = new DateOnly(2026, 9, 10),
Seller = new BusinessParty { Name = "Cantriva Solutions", Email = "billing@cantriva.com" },
Customer = new BusinessParty { Name = "Northstar Operations Pvt. Ltd.", Email = "finance@northstar.example" },
PaymentMethod = "Bank transfer",
TransactionId = "TXN-CAN-7781",
Items = new[]
{
new ReceiptLineItem { Description = "Paid invoice CPDF-2026-0910", Quantity = 1, UnitPrice = 43840 }
},
CurrencySymbol = "INR ",
Notes = "Payment received in full.",
TemplateOptions = new BusinessDocumentTemplateOptions
{
Template = BusinessDocumentTemplate.ReceiptPayment,
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 = "Official CantrivaPdf payment receipt"
}
}, "premium-receipt-payment.pdf");A ledger-style account statement with opening balance, charges, payments, and closing balance.
using CantrivaPdf.Sdk;
using CantrivaPdf.Sdk.Documents;
var logoPath = @"C:\app\assets\cantriva-logo.png";
var accentColor = "#0f766e";
await PdfGenerator.SaveStatementAsync(new StatementPdfRequest
{
StatementNumber = "ST-CPDF-1001",
StatementDate = new DateOnly(2026, 9, 10),
PeriodStart = new DateOnly(2026, 9, 1),
PeriodEnd = new DateOnly(2026, 9, 30),
Issuer = new BusinessParty { Name = "Cantriva Solutions", Email = "billing@cantriva.com" },
AccountHolder = new BusinessParty { Name = "Northstar Operations Pvt. Ltd.", Email = "finance@northstar.example" },
CurrencySymbol = "INR ",
OpeningBalance = 12000,
Transactions = new[]
{
new StatementLineItem { Date = new DateOnly(2026, 9, 3), Description = "Invoice CPDF-2026-0910", Charge = 43840 },
new StatementLineItem { Date = new DateOnly(2026, 9, 8), Description = "Payment received", Payment = 30000 },
new StatementLineItem { Date = new DateOnly(2026, 9, 10), Description = "Receipt RCPT-CPDF-1001", Payment = 13840 }
},
TemplateOptions = new BusinessDocumentTemplateOptions
{
Template = BusinessDocumentTemplate.StatementLedger,
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 = "Account statement generated by CantrivaPdf"
}
}, "premium-statement-ledger.pdf");A tiny controlled HTML-to-PDF example for developers who already own the HTML template.
using CantrivaPdf.Sdk;
await PdfGenerator.SaveAsync("""
<style>
.invoice { font-family: Arial; font-size: 11px; line-height: 15px; color: #1f2937; }
h1 { font-size: 28px; line-height: 34px; margin: 0 0 14px 0; color: #111827; }
p { font-size: 11px; line-height: 15px; margin: 0 0 16px 0; }
table { width: 523px; margin-top: 8px; border: 1px solid #d1d5db; }
th { font-size: 11px; line-height: 14px; font-weight: bold; background-color: #f3f4f6; color: #111827; padding: 8px 10px; border: 1px solid #d1d5db; }
td { font-size: 11px; line-height: 14px; padding: 8px 10px; border: 1px solid #d1d5db; }
.right { text-align: right; }
.total-label { font-weight: bold; }
</style>
<div class="invoice">
<h1>Invoice #1001</h1>
<p><strong>Customer:</strong> Contoso Ltd.</p>
<table>
<tr><th>Description</th><th class="right">Total</th></tr>
<tr><td>Rendering services</td><td class="right">$250.00</td></tr>
<tr><td class="total-label">Amount Due</td><td class="right"><b>$250.00</b></td></tr>
</table>
</div>
""", "premium-html-invoice.pdf");