The promise of "FREE" HTML-to-PDF conversion attracts many .NET developers to NReco.PdfGenerator. The reality is more complicated. The free version carries restrictions that only become apparent after integration, the commercial pricing requires direct contact with sales, and the underlying technology—wkhtmltopdf—was archived in 2023 and marked as deprecated. For teams evaluating NReco.PdfGenerator, understanding these constraints upfront can save significant development time.
The Problem
NReco.PdfGenerator markets itself as a free HTML-to-PDF converter for .NET applications. The NuGet package page and official website prominently display "FREE" messaging. What the marketing buries in fine print: the free version is restricted to single-server, non-SaaS deployments on Windows only. Any other deployment scenario requires a commercial license.
The licensing situation becomes more complex when teams need cross-platform support. NReco.PdfGenerator.LT, the cross-platform version that works on Linux, macOS, and Docker, is not available for free users at all. Developers who prototype on Windows and then deploy to Linux containers discover they need a paid license only after significant development investment.
Beyond licensing, NReco.PdfGenerator wraps wkhtmltopdf, a command-line tool that was archived on January 2, 2023, and whose organization was marked as deprecated on July 10, 2024. Every limitation and security vulnerability in wkhtmltopdf is inherited by NReco.PdfGenerator.
The Free Version Restrictions
The actual licensing terms for NReco.PdfGenerator:
Free Usage Allowed:
- Single-server production deployment
- Non-SaaS applications
- Windows only (x86/x64)
Paid License Required:
- Multiple deployments
- Multi-server production environments
- SaaS applications
- .NET Core on Linux/macOS
- Docker containers
- Azure App Services
- AWS Lambda
The LT (cross-platform) package states explicitly: "LT nuget is not available for free users. Please contact support@nrecosite.com if you want to get a demo key for evaluation/testing purposes."
Pricing Opacity
NReco's commercial pricing is not published on their website. The only publicly visible pricing is "$199" for an "enterprise source pack" which includes source code access, commercial license, and one year of email support. For other licensing scenarios—team licenses, volume deployments, OEM redistribution—developers must email support@nrecosite.com and wait for a quote.
This opacity creates several problems:
- Budget planning: Developers cannot estimate project costs without engaging sales
- Comparison shopping: Evaluating alternatives requires waiting for quotes from each vendor
- Approval delays: Enterprise procurement processes stall without documented pricing
- Hidden costs: Teams discover license requirements after development is complete
Who Is Affected
Development Teams Scaling Beyond Single Server
The most common scenario: a development team builds a PDF generation feature using the free NReco.PdfGenerator package. The feature works in development and passes QA on a single staging server. When deploying to production with load balancing across multiple servers, they discover a commercial license is required.
Teams Deploying to Linux or Docker
Modern .NET deployments increasingly target Linux containers. Teams using the standard NReco.PdfGenerator package on Windows find it simply does not work on Linux. The package embeds Windows-only wkhtmltopdf binaries. To run on Linux, they need NReco.PdfGenerator.LT—which requires a paid license even for evaluation.
SaaS Application Developers
Any multi-tenant application serving multiple customers from shared infrastructure violates the free license terms. The definition of "SaaS" is not clarified in the license, leaving gray areas around internal tools, customer portals, and hybrid deployment models.
Azure and Cloud Deployments
Azure App Services, Azure Functions, AWS Lambda, and similar serverless platforms often run multiple instances automatically. This multi-server deployment requires commercial licensing, even if the application only processes PDFs occasionally.
Evidence from the Developer Community
License Discovery Issues
Developers consistently report discovering license requirements late in development:
"NReco.PdfGenerator can be used for FREE in .NET apps that have only one single-server production deployment. A commercial license is required for applications with multiple deployments, or one multi-server production deployment."
— NReco Official Documentation
The C# Corner forums contain threads where developers encounter encoding issues and deployment problems, only to discover they need the commercial LT package for their target environment.
Azure Function App Failures
One documented case involves Azure Function Apps:
"On Azure Function Apps, during object creation of NReco.PdfGenerator.HtmlToPdfConverter(), it picks a path like 'D:\Program Files (x86)\SiteExtensions\Functions...' which is read-only, causing failures."
— Developer blog, January 2023
The suggested workaround requires setting PdfToolPath to a writable location—but this only addresses the path issue, not the underlying licensing requirement for cloud deployments.
Exit Code Errors
GitHub issues on the wkhtmltopdf repository contain multiple NReco-related bug reports:
"Exit with code 1, due to unknown error" - Exception thrown by NReco.PdfGenerator.WkHtmlToPdfException
These errors often stem from wkhtmltopdf limitations that NReco cannot fix because it merely wraps the abandoned tool.
Inherited wkhtmltopdf Problems
NReco.PdfGenerator is a .NET wrapper around wkhtmltopdf. Every problem in wkhtmltopdf becomes a problem in NReco.PdfGenerator.
Security Vulnerabilities
CVE-2020-21365: A directory traversal vulnerability in wkhtmltopdf through version 0.12.5 allows remote attackers to read local files via crafted HTML files. This vulnerability enables Local File Inclusion (LFI) attacks.
SSRF Vulnerabilities: wkhtmltopdf processes HTML on the server side, making it a high-risk target for Server-Side Request Forgery. Attackers can inject iframes pointing to internal network resources:
<!-- Malicious HTML that exploits SSRF vulnerability -->
<iframe src="http://169.254.169.254/latest/meta-data/"></iframe>
In AWS environments, this can expose EC2 instance metadata, potentially leading to credential theft. The Ubuntu Security Notice USN-6232-1 documents that wkhtmltopdf "was not properly enforcing the same-origin policy when processing certain HTML files."
These vulnerabilities will never be fixed in wkhtmltopdf—and therefore will never be fixed in NReco.PdfGenerator.
CSS Rendering Limitations
wkhtmltopdf uses Qt WebKit, a rendering engine frozen at approximately Chrome 13 standards (circa 2013). Modern CSS features do not work:
Not Supported:
- CSS Grid (
display: grid) - Modern Flexbox (requires
-webkit-boxprefixes, often broken) - CSS Variables (
var(--custom-property)) -
calc()expressions (unreliable) - CSS Columns
- Many transform properties
From wkhtmltopdf GitHub Issues:
"flexbox layout doesn't work" — Issue #1522
"CSS grid layout - supported?" — Issue #3661 (Answer: No)
"CSS flex-box support doesn't exist?" — Issue #2100
Developers report: "Grid and flex doesn't work in PDF print format. Use table instead." This forces developers to maintain separate HTML layouts—one for web browsers, one for PDF generation.
Deprecated and Abandoned
The wkhtmltopdf organization on GitHub was marked as archived on July 10, 2024. The downloads page now warns: "Obsolete - DO NOT USE!"
CiviCRM issued a Public Service Announcement (CIVI-PSA-2024-01) explicitly declaring wkhtmltopdf end-of-life.
Homebrew disabled the wkhtmltopdf cask on December 16, 2024, stating: "This cask has been disabled because it is discontinued upstream."
NReco.PdfGenerator cannot escape this reality. It wraps a tool that its own creators have abandoned and labeled obsolete.
Attempted Workarounds
For CSS Limitations
Developers attempt to work around CSS limitations by:
- Using only legacy CSS: Avoiding flexbox and grid entirely, using tables and floats
- Maintaining dual templates: One modern template for browsers, one legacy template for PDF
-
Adding WebKit prefixes:
-webkit-boxinstead ofdisplay: flex
None of these approaches enable modern CSS frameworks like Tailwind CSS or Bootstrap 5 to render correctly.
For Security Vulnerabilities
Mitigations include:
- HTML sanitization: Stripping iframes, scripts, and external references before processing
- Network isolation: Running PDF generation in isolated environments without network access
- Input validation: Rejecting user-supplied HTML entirely
These workarounds add development complexity and cannot guarantee complete protection.
For Deployment Issues
For Azure Function Apps, setting a custom PdfToolPath can resolve read-only path errors. However, this does not address the fundamental issue: running on Azure requires commercial licensing.
A Different Approach: IronPDF
For teams evaluating NReco.PdfGenerator or considering migration, IronPDF provides an alternative architecture that addresses the core limitations.
Why IronPDF Avoids These Issues
IronPDF embeds a Chromium rendering engine rather than wrapping an external command-line tool:
- Modern CSS support: Full Flexbox, CSS Grid, CSS Variables, calc()
- JavaScript execution: ES6+, React, Vue, Angular render correctly
- No wkhtmltopdf dependency: Does not inherit abandoned software vulnerabilities
- Transparent licensing: Pricing published on website, no sales contact required
- Cross-platform included: Same package works on Windows, Linux, macOS, Docker
Transparent Licensing Model
IronPDF publishes pricing directly on their website. Developers can see costs immediately:
- Per-developer licensing with clear tier definitions
- Free trial for evaluation (functional, not time-limited)
- No separate package for cross-platform support
- No "contact sales" requirement for standard licenses
This transparency enables teams to evaluate costs during planning rather than discovering them during deployment.
Code Example: Basic HTML to PDF
using IronPdf;
public class PdfGenerator
{
public byte[] GeneratePdfFromHtml(string htmlContent)
{
// IronPDF uses embedded Chromium - no external wkhtmltopdf process
var renderer = new ChromePdfRenderer();
// Configure page settings
renderer.RenderingOptions.PaperSize = IronPdf.Rendering.PdfPaperSize.A4;
renderer.RenderingOptions.MarginTop = 10;
renderer.RenderingOptions.MarginBottom = 10;
renderer.RenderingOptions.MarginLeft = 10;
renderer.RenderingOptions.MarginRight = 10;
// Convert HTML to PDF - modern CSS works correctly
using (var pdf = renderer.RenderHtmlAsPdf(htmlContent))
{
return pdf.BinaryData;
}
}
}
Code Example: Modern CSS That Actually Renders
The following CSS works in IronPDF but fails in NReco.PdfGenerator:
using IronPdf;
public class ModernLayoutExample
{
public void GenerateModernPdf()
{
var renderer = new ChromePdfRenderer();
renderer.RenderingOptions.EnableJavaScript = true;
string html = @"
<!DOCTYPE html>
<html>
<head>
<style>
/* CSS Grid - not supported in wkhtmltopdf/NReco */
.report-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 16px;
padding: 20px;
}
/* CSS Variables - not supported in wkhtmltopdf/NReco */
:root {
--brand-color: #1e40af;
--card-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.metric-card {
background: white;
padding: 16px;
border-radius: 8px;
box-shadow: var(--card-shadow);
border-top: 3px solid var(--brand-color);
}
/* Flexbox - broken in wkhtmltopdf/NReco */
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
}
/* calc() - unreliable in wkhtmltopdf/NReco */
.content-area {
width: calc(100% - 40px);
margin: 0 auto;
}
</style>
</head>
<body>
<div class='content-area'>
<div class='report-grid'>
<div class='metric-card'>
<div class='card-header'>
<span>Revenue</span>
<span>+12%</span>
</div>
<h2>$125,000</h2>
</div>
<div class='metric-card'>
<div class='card-header'>
<span>Users</span>
<span>+8%</span>
</div>
<h2>4,521</h2>
</div>
<div class='metric-card'>
<div class='card-header'>
<span>Orders</span>
<span>+15%</span>
</div>
<h2>892</h2>
</div>
</div>
</div>
</body>
</html>";
using (var pdf = renderer.RenderHtmlAsPdf(html))
{
pdf.SaveAs("modern-report.pdf");
}
}
}
Code Example: Cross-Platform Deployment
The same code works identically on Windows, Linux, macOS, and Docker:
using IronPdf;
public class CrossPlatformPdfService
{
public byte[] GenerateInvoice(InvoiceData invoice)
{
// No platform-specific configuration needed
// Same code runs on Windows dev machine and Linux Docker container
var renderer = new ChromePdfRenderer();
renderer.RenderingOptions.PaperSize = IronPdf.Rendering.PdfPaperSize.A4;
renderer.RenderingOptions.PrintHtmlBackgrounds = true;
string html = BuildInvoiceHtml(invoice);
using (var pdf = renderer.RenderHtmlAsPdf(html))
{
return pdf.BinaryData;
}
}
private string BuildInvoiceHtml(InvoiceData invoice)
{
// Build invoice HTML with modern CSS
return $@"
<!DOCTYPE html>
<html>
<head>
<style>
body {{ font-family: system-ui, sans-serif; }}
.invoice-header {{
display: flex;
justify-content: space-between;
border-bottom: 2px solid #e5e7eb;
padding-bottom: 20px;
}}
.line-items {{
display: grid;
grid-template-columns: 3fr 1fr 1fr 1fr;
gap: 8px;
}}
</style>
</head>
<body>
<div class='invoice-header'>
<div>
<h1>Invoice #{invoice.Number}</h1>
<p>{invoice.CustomerName}</p>
</div>
<div>
<p>Date: {invoice.Date:d}</p>
<p>Due: {invoice.DueDate:d}</p>
</div>
</div>
<!-- Invoice line items -->
</body>
</html>";
}
}
API Reference
For more details on the methods used:
- ChromePdfRenderer - Main HTML to PDF rendering class
- RenderingOptions - Page configuration options
- Docker and Linux Deployment - Container deployment guide
- HTML to PDF Tutorial - Getting started guide
Migration Considerations
Licensing
IronPDF is commercial software with per-developer licensing. Unlike NReco, pricing is published publicly on the IronPDF website. A functional trial (not time-limited) allows thorough evaluation. The same license covers all platforms—no separate "LT" package for Linux.
API Differences
Migrating from NReco.PdfGenerator requires code changes:
| NReco.PdfGenerator | IronPDF |
|---|---|
HtmlToPdfConverter |
ChromePdfRenderer |
GeneratePdf(html) |
RenderHtmlAsPdf(html) |
PageSize property |
RenderingOptions.PaperSize |
Margins properties |
RenderingOptions.MarginTop/Bottom/Left/Right |
| wkhtmltopdf binary dependency | Embedded Chromium (no external files) |
| Separate LT package for Linux | Same package for all platforms |
What You Gain
- Modern CSS rendering without workarounds
- Published, transparent pricing
- Cross-platform support included (not a separate paid package)
- No inherited security vulnerabilities from abandoned wkhtmltopdf
- Active development with regular updates
- JavaScript framework support
What to Consider
- Commercial licensing cost (but pricing is visible upfront)
- Different API surface requiring code changes
- Slightly different rendering output (Chromium vs WebKit)
- Larger deployment size due to embedded Chromium engine
Conclusion
NReco.PdfGenerator's "free" marketing obscures significant restrictions: Windows-only, single-server, non-SaaS deployments. The cross-platform version requires commercial licensing, and that pricing is not published. More fundamentally, NReco wraps wkhtmltopdf—a tool officially abandoned in 2023 with known unpatched security vulnerabilities and CSS rendering frozen at 2013 standards. Teams evaluating PDF generation libraries should understand these constraints before investing development time. For modern .NET applications requiring cross-platform deployment, current CSS support, and transparent licensing, alternatives with actively maintained rendering engines provide a more sustainable foundation.
Written by Jacob Mellor, who leads technical development at Iron Software and has spent 25+ years building developer tools.
References
- NReco.PdfGenerator Official Site{:rel="nofollow"} - Product page with licensing terms
- NReco.PdfGenerator NuGet Package{:rel="nofollow"} - Package listing
- NReco.PdfGenerator.LT NuGet Package{:rel="nofollow"} - Cross-platform version
- wkhtmltopdf GitHub Organization{:rel="nofollow"} - Archived July 10, 2024
- CVE-2020-21365 - Directory Traversal{:rel="nofollow"} - Security vulnerability
- USN-6232-1: wkhtmltopdf vulnerability{:rel="nofollow"} - Ubuntu Security Notice
- wkhtmltopdf Flexbox Issue #1522{:rel="nofollow"} - CSS limitation
- wkhtmltopdf CSS Grid Issue #3661{:rel="nofollow"} - CSS limitation
- CIVI-PSA-2024-01: wkhtmltopdf EOL{:rel="nofollow"} - End of life advisory
- wkhtmltopdf is now abandonware - Doppio{:rel="nofollow"} - Industry assessment
- NReco Azure Function App Issue{:rel="nofollow"} - Deployment problems
- Encoding issue with NReco - C# Corner{:rel="nofollow"} - Developer forum discussion
For IronPDF documentation and tutorials, visit ironpdf.com.
Top comments (0)