Blog Logo
TAGS

Rendering PDFs with Razor Templates and PuppeteerSharp in Azure Functions

Learn how to render PDFs in Azure Functions using Razor and the C# port of Puppeteer, PuppeteerSharp. Well run ASP.NET Core Razor Pages in a .NET Azure Functions app and use PuppeteerSharp with headless Chromium to render the invoice Razor template to a PDF. Follow the steps outlined in the article to build an ASP.NET Core Razor Pages app, create an Azure Functions app and configure it to run PuppeteerSharp, run the ASP.NET Core Razor Pages app in the function app, write a function that uses PuppeteerSharp to render the invoice and generate a PDF, and deploy the app to Azure. The Razor code and OnPost method are included for reference, check out the tutorial linked for more information on Razor Pages.