Developer builds QR code generator from scratch in C# to keep PDF library dependency-free
A developer maintaining TerraPDF, a zero-dependency, MIT-licensed .NET PDF library, needed to add QR codes to PDF invoices but could not use third-party packages like ZXing.Net due to the project's strict no-external-dependency rule. To work around this, they spent a weekend manually implementing Reed-Solomon error correction and BCH codes entirely in pure C#. TerraPDF was created to address common pain points in .NET PDF tooling, including native binary dependencies, restrictive licensing models, and low-level verbose APIs. The library already included hand-rolled support for PNG/JPEG images, tables, encryption, and vector graphics before barcode support was attempted. While Code128 barcodes proved relatively straightforward to implement, QR code generation required significantly more complex mathematical work, including finite field arithmetic over GF(256).
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in