Recommended Free Tools
Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
For modern, JavaScript-heavy pages, start with a Chromium-based library. IronPDF offers a high-level commercial C# API, while PuppeteerSharp gives you direct Chromium control under the MIT license. Choose iText pdfHTML when parser-based conversion, PDF manipulation, or a documented PDF/UA path matters. Use Playwright .NET when browser automation is already central to your application, and do not treat PDFsharp as an HTML renderer by itself.
The right choice depends less on a “best” brand than on rendering fidelity, browser deployment, concurrency, pagination, licensing, accessibility requirements, and how much PDF post-processing you need.
Quick decision guide
| Library or approach | Rendering model | JavaScript | License or commercial position | Best fit |
|---|---|---|---|---|
| IronPDF | Chromium-based renderer | Yes, through browser rendering | Commercial component | Teams that want a supported, high-level C# API and Chrome-like output |
| PuppeteerSharp | Drives Chrome or Chromium | Yes | MIT | Teams that need direct browser control and can operate the browser runtime |
| iText pdfHTML | Parser-based HTML/CSS conversion | Not a general browser runtime | AGPL or commercial, depending on the application | Projects already using iText, needing PDF features, or pursuing its documented PDF/UA path |
| Playwright .NET | Automates Chromium, Firefox, and WebKit | Yes | Check the release and your organization’s terms | Applications that already use Playwright for browser automation |
| wkhtmltopdf | External native executable or wrapper | Depends on its rendering engine and page behavior | Review the selected distribution | Existing systems that can manage a native process |
| PDFsharp | PDF creation and editing, not HTML rendering | No HTML engine | Review the selected package | Drawing or editing PDF content after another component renders HTML |
How to choose an HTML-to-PDF library
Rendering fidelity and JavaScript
If the source page depends on modern CSS, client-side JavaScript, web fonts, lazy images, or application state created after load, a real browser engine is usually the safest starting point. IronPDF documents a Chromium renderer, and PuppeteerSharp drives Chrome or Chromium directly. Both approaches render the page the way a browser does, but they also bring browser startup, executable packaging, sandboxing, and resource-management decisions.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Parser-based conversion can be easier to run as a small library process and can be a better fit for controlled HTML and CSS. iText pdfHTML is specifically an add-on for iText Core that converts HTML/XML and CSS to PDF. It is not a drop-in replacement for a browser when a page’s appearance depends on arbitrary JavaScript execution.
#1 Best Overall
Pagination and print CSS
Before selecting a library, identify your print rules: paper size, margins, orientation, page breaks, repeating headers, footers, background graphics, and whether a page range must be exported. Browser-based APIs expose print-oriented controls, but exact behavior still depends on the browser version and the page’s CSS. A parser-based converter may give you more deterministic control over supported markup, while unsupported CSS or browser-only behavior can require template changes.
Deployment, memory, and concurrency
Do not use a neutral benchmark number to size production. The reviewed sources publish no decision-grade speed, memory, accuracy, or market-share figures. Measure your own templates with their real fonts, images, JavaScript, page counts, and concurrency. Browser processes generally need an explicit lifecycle policy: reuse a browser where safe, isolate jobs that can leak state, cap parallel pages, and recycle processes when long-running workloads show degradation. Parser-based conversion still needs load testing, especially for large documents and image-heavy templates.
Accessibility and PDF standards
If PDF/UA or another standards target is contractual, make it a selection criterion rather than an afterthought. iText’s feature matrix documents HTML/CSS conversion and an HTML-to-PDF/UA path through pdfHTML. Confirm the exact conformance level, tags, reading order, language metadata, and validation process required by your project.
IronPDF: the high-level Chromium option
IronPDF is the most direct choice when you want browser-grade rendering without building the entire browser orchestration layer yourself. Its C# tutorial documents NuGet installation, rendering an HTML string, converting a URL or HTML page, adding custom headers and footers, and saving the result. The output is intended to match Google Chrome through a Chromium-based renderer.
Minimal C# example
using IronPdf;
class Program
{
static void Main()
{
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf("<html><body><h1>Invoice</h1><p>Paid</p></body></html>");
pdf.SaveAs("invoice.pdf");
}
}
For a remote page, use the renderer’s URL conversion method documented for your installed package version. Keep network access, authentication, cookies, and outbound requests explicit; a URL conversion can expose your service to slow pages or untrusted destinations.
Rank #2
When IronPDF is a good fit
- You value a concise, supported C# surface over assembling browser launch and page-management code.
- Your templates rely on contemporary CSS or JavaScript and should look like browser print output.
- A commercial component is acceptable and its licensing cost fits the project.
Trade-offs
- You still need to plan for browser-like runtime resources and deployment behavior.
- Commercial licensing must be reviewed before shipping, including production and build environments.
- For very specialized PDF manipulation, you may still need a separate PDF library or an iText-based workflow.
PuppeteerSharp: direct Chromium control under MIT
PuppeteerSharp is a .NET port of the official Node.js Puppeteer API. Its examples cover setting page content from HTML, navigating to a URL, waiting for selectors, and calling page.PdfAsync. The package is MIT licensed, but your deployment must provide a compatible Chrome or Chromium runtime and keep that runtime updated.
Minimal C# example
using PuppeteerSharp;
class Program
{
static async Task Main()
{
await using var browser = await Puppeteer.LaunchAsync(new LaunchOptions
{
Headless = true
});
await using var page = await browser.NewPageAsync();
await page.SetContentAsync("<html><body><h1>Invoice</h1><p>Paid</p></body></html>");
await page.PdfAsync("invoice.pdf", new PdfOptions
{
Format = PaperFormat.A4,
PrintBackground = true
});
}
}
In a real service, configure the executable path or browser installation strategy required by your PuppeteerSharp version, then pin and update the browser deliberately. For dynamic pages, navigate to the URL and wait for a meaningful selector rather than relying only on a fixed delay. Waiting for a selector makes the PDF depend on an observable application state.
When PuppeteerSharp is a good fit
- You need direct control over navigation, selectors, scripts, cookies, and browser context.
- MIT licensing is important and your team can package, patch, and operate Chrome or Chromium.
- The same browser automation layer will also support testing or data capture.
Operational cautions
- Do not launch an unrestricted browser for every request under load; define pooling, queue limits, and timeouts.
- Use isolated contexts for tenant data and authenticated pages.
- Block or validate untrusted URLs, and restrict outbound network access where possible.
iText pdfHTML: parser-based conversion and PDF workflows
iText describes pdfHTML as an add-on for iText Core that converts HTML/XML and CSS to PDF in Java and C#. It is attractive when the application already relies on iText’s PDF manipulation capabilities or needs its documented PDF/UA route.
Basic conversion shape
using System.IO;
using iText.Html2pdf;
class Program
{
static void Main()
{
using var output = File.Create("invoice.pdf");
HtmlConverter.ConvertToPdf(
"<html><body><h1>Invoice</h1></body></html>",
output);
}
}
Use the API and package versions that match your iText installation, then add the document properties, fonts, CSS, and tagging configuration required by your standard. A parser-based engine does not automatically reproduce every behavior of a live browser page, so test unsupported CSS and JavaScript-dependent templates early.
Licensing is a design input
iText’s .NET guidance says commercial or closed-source use requires a commercial license and the appropriate license-key library. The alternative licensing path is AGPL, with obligations that may not fit a proprietary application. Have counsel review the exact distribution and deployment model before implementation.
Playwright .NET: useful when browser automation is already in your stack
Microsoft’s Playwright .NET repository describes the project as the official .NET port for automating Chromium, Firefox, and WebKit through one API. It is a broad browser-automation platform, not a narrowly focused HTML-to-PDF package. If your test or automation infrastructure already uses Playwright, reusing that stack can reduce operational duplication.
Verify the exact PDF-printing API, browser installation procedure, and resource requirements for the release you select. Do not assume that an API shown for another Playwright language or version has identical C# names or defaults. For a new PDF-only service, compare that additional surface area with IronPDF or PuppeteerSharp before committing.
wkhtmltopdf and PDFsharp: common sources of confusion
wkhtmltopdf
wkhtmltopdf integration requires a native executable or a wrapper. That can work in an existing environment, but you must manage process startup, executable availability, architecture, permissions, timeouts, and the rendering behavior of the installed binary. Treat it as an external dependency rather than a pure managed C# library.
PDFsharp
PDFsharp creates and edits PDFs but has no HTML rendering engine. It cannot, by itself, take arbitrary HTML and turn it into a laid-out PDF. Pair it with a separate renderer, or use it after conversion for drawing, merging, or editing operations.
A production implementation checklist
- Define the input contract. Decide whether callers submit trusted templates, arbitrary HTML, or URLs. Restrict remote navigation and sanitize untrusted markup.
- Choose the renderer. Use Chromium for browser fidelity and JavaScript; choose pdfHTML for a parser-based iText workflow; reuse Playwright when it is already a core dependency.
- Pin versions. Record the .NET target, NuGet packages, browser build, native executable version if applicable, and font set.
- Make readiness explicit. Wait for a selector, network-idle condition, or application-specific signal. Avoid a single arbitrary sleep for every page.
- Control resources. Set navigation and conversion timeouts, cap concurrent jobs, limit page size and image dimensions, and recycle unhealthy browser workers.
- Test pagination. Include long tables, headings near page boundaries, missing images, custom fonts, right-to-left text, landscape pages, and deliberate page breaks.
- Validate the PDF. Check page count, metadata, links, text extraction, visual output, and accessibility requirements in automated tests.
- Observe failures. Log the template or URL identifier, renderer version, elapsed time, page count, and a safe failure reason without storing secrets.
Troubleshooting
The PDF is blank
The page may still be loading, JavaScript may have failed, or the browser could not reach a required resource. Wait for a selector that only appears after rendering, capture console and network errors, and verify that fonts, images, and API calls are reachable from the server.
Rank #4
CSS or fonts differ from the browser
Check the installed browser or parser version, confirm that the font files are present in the deployment image, and inspect print-specific CSS. A page that looks correct on a developer workstation can change when a server lacks the same fonts or has different media settings.
Images are missing
Verify absolute URLs, authentication headers, certificate trust, and outbound firewall rules. For data URLs or generated assets, ensure the renderer receives the complete HTML before conversion.
Conversion times out
Find whether the delay comes from DNS, a third-party request, an infinite script, a large image, or browser startup. Set bounded timeouts, remove unnecessary resources, wait for a deterministic readiness signal, and return a retryable error rather than holding a worker forever.
Concurrent jobs exhaust memory
Reduce parallel pages, reuse a controlled browser pool, cap document dimensions, and measure memory with your actual templates. If a worker becomes unhealthy after repeated jobs, recycle it instead of allowing an unbounded process to continue.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitchesLicensing blocks release
Recheck the application’s distribution model. PuppeteerSharp is MIT licensed; iText pdfHTML may require AGPL compliance or a commercial license; IronPDF is a commercial component. Keep license review in the architecture phase, not just procurement.
Best Value
Or skip the browser setup: ScreenshotNeo
If you need a hosted screenshot or PDF endpoint rather than an in-process C# renderer, ScreenshotNeo accepts one GET request and returns a clean screenshot or PDF. Before capture it accepts cookie and consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be disabled. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and each response identifies the result with X-Page-Verdict and X-Billed headers.
The API also supports full-page capture with lazy images loaded, CSS-selector element capture, dark mode, 12 device presets or any viewport, retina scale, PDF paper size, margins, landscape mode and page ranges, custom CSS and JavaScript, clicks before capture, hidden selectors, selector or network-idle waits, request and resource blocking, custom headers, cookies, user agents and Authorization, timezone and geolocation, transparent backgrounds, resizing, TTL-based caching, signed links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, a usage API, an OpenAPI specification, and familiar parameter names for easier migration.
See the ScreenshotNeo API documentation for response-format options. The basic request is:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Python:
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
Node.js:
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
ScreenshotNeo is worth trying first when you want clean captures without maintaining a browser fleet: 1,000 screenshots per month are free with no card, paid plans start at $5 for 3,000, and an MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. Sign up free.
Recommended decision
Pick IronPDF for the shortest path to supported Chromium-based C# rendering. Pick PuppeteerSharp when MIT licensing and low-level browser control outweigh the work of operating Chrome or Chromium. Pick iText pdfHTML for an iText-centered, parser-based PDF workflow or its documented PDF/UA path, after resolving AGPL or commercial licensing. Pick Playwright .NET when browser automation is already a first-class dependency. Use PDFsharp only as a PDF manipulation component alongside a real HTML renderer.
Frequently Asked Questions
Which option is the best free alternative to IronPDF?
PuppeteerSharp is the clearest free-software alternative in this comparison because its NuGet package is MIT licensed. You must still provide and operate a compatible Chrome or Chromium runtime.
Can these libraries convert a URL that requires login?
Browser-based approaches can work with authenticated pages when you supply the required cookies, headers, or session setup. Design that flow explicitly and never expose credentials to untrusted URL input.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchShould I benchmark before choosing?
Yes. No neutral, decision-grade benchmark figures are established here. Measure your own templates, fonts, images, JavaScript, page counts, and target concurrency.
When should a service use a hosted API instead of a .NET library?
Use a hosted API when avoiding browser installation, cleanup logic, and runtime operations is more important than keeping conversion inside your process. Confirm its security, data-handling, output, and cost requirements first.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

