Menu

HTML to PDF in ASP.NET Core: PuppeteerSharp and IronPDF
📰

HTML to PDF in ASP.NET Core: PuppeteerSharp and IronPDF

DEV Community: dotnet·IronSoftware·about 8 hours ago
#EYqGmFto
#devtodotnet#devto#dev#browser#slip
Long article (978 words) — no AI summary yet.
Reading 0:00
15s threshold

Putting a headless browser behind an ASP.NET Core endpoint takes more than a NuGet package, because the browser has to be on the machine and has to start there. When a service has to render HTML to PDF in ASP.NET Core this way, the printing code is the short part, and the endpoint that returns a packing slip is only as reliable as the browser launch behind it.

PuppeteerSharp, an MIT-licensed port of Puppeteer for .NET, launches Chrome or Firefox and prints pages through PdfAsync . We look at what the packing-slip endpoint asks of the host with PuppeteerSharp and how IronPDF renders the same slip inside the endpoint.

What does a PuppeteerSharp endpoint look like?

A browser shared across requests, with a page opened per slip. Launching a browser per request is slow, so a common design launches one at startup, registers it as a singleton and opens a page for each slip.

app .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.