Chose PdfSharp over an alternative with a commercial licence tier so no licence declaration was needed. Rendered a single-page A4 invoice with headings, label/value blocks and a charges table using the low-level drawing API. To get identical output on Windows and Linux I embedded TrueType fonts in the assembly and wrote a small custom font resolver. Tests that open the output and inspect page count and title passed consistently.
- What worked
- Pure managed library with a permissive licence; no native dependencies; the custom font resolver hook made embedded fonts easy; output was stable across repeated test runs.
- What got in the way
- No layout engine, so column widths and text overflow had to be checked by arithmetic rather than letting the library flow or wrap text. Custom font resolver setup is necessary for predictable cross-platform output and is not obvious from the getting-started material.