Skip to content
/ Michaël Hompus

Generating PDFs in .NET is often painful—low-level drawing APIs, rigid libraries, and pricey licenses all get in the way. Playwright flips the script: design with plain HTML and CSS, then export directly to PDF. This walkthrough shows how to load a template, replace placeholders at runtime, and generate a styled PDF with Playwright in .NET.

Generating a nicely formatted PDF is surprisingly hard with traditional .NET libraries. Pixel‑perfect layout often requires low‑level drawing APIs or proprietary tooling.

When looking for a solution, I stumbled upon Microsoft Playwright, a library for end-to-end testing in the browser.

This in itself might not sound like a good fit for PDF generation, but if you know that the print preview inside a Chromium browser is actually a rendered PDF, it makes more sense.

So if we can render HTML in a browser, we can also export it to PDF. And this gives us all the flexibility of HTML and CSS for layout, without the hassle of low-level drawing APIs.

read more…
Filed under C#
Last update:
/ Michaël Hompus

As I continue migrating from WordPress to Astro, I am rebuilding key plugin features without third-party dependencies. In this post, I will show how I replaced syntax highlighting, recent post widgets, and external link management using Astro’s flexible ecosystem.

This post is a continuation of my migration journey from WordPress to Astro. If you have not read the previous posts, you might want to start with Why I Switched from WordPress to Astro, How I Moved My Blog Content and how I am Replacing WordPress Plugins with Astro: Acronyms, Meta Tags & Tag Clouds.

In this post, I cover how I replaced the next set of WordPress plugins with equivalent functionality in Astro:

  1. Enlighter
  2. Recent Post Widget Extended
  3. WP External Links
read more…
Filed under Azure
Last update:
/ Michaël Hompus

Moving from WordPress to Astro meant rethinking how I implemented various features that were previously handled by plugins. In this post, I explain how I replaced key WordPress plugin functionalities in Astro, including acronyms, metadata, and tag clouds.

This post is a continuation of my migration journey from WordPress to Astro. If you have not read the previous posts, you might want to start with:

In this post, I explain how I replaced 3 WordPress plugin functionalities in Astro.

  1. Acronyms 2
  2. Add Meta Tags
  3. Better Tag Cloud
read more…
Filed under Azure
Last update:
/ Michaël Hompus

After 15 years of blogging with WordPress, I decided to take the plunge and migrate my blog to Astro. This post outlines how I moved my content, step by step, and the tools I used to make the transition.

After 15 years of blogging with WordPress, I decided to take the plunge and migrate my blog to Astro.

This post outlines how I moved my content, step by step, and the tools I used to make the transition.

This is a follow-up to my previous post: Why I Switched from WordPress to Astro: Faster, Cheaper, and Greener.

read more…
Filed under Azure
Last update:
/ Michaël Hompus

For years, WordPress was my go-to platform for blogging, but it was time for a change—one that aligns better with my values, both environmentally and financially. In this post, I share the reasons behind my decision to move to an Astro app deployed on Azure Static Web Apps.

For years, WordPress was my go-to platform for blogging, but it was time for a change—one that aligns better with my values, both environmentally and financially.

While WordPress has been a fantastic tool for blogging, offering countless features and an active community, I recently decided it was time to move on.

My blog now runs as a static web app built with Astro and published on Azure Static Web Apps.

Why make this change? Let me explain.

read more…
Filed under Azure
Last update: