Watermarking a PDF — adding semi-transparent text over pages — sounds like something only desktop software handles. But with pdf-lib and a bit of canvas math, you can build a fully browser-based watermark tool.

This post walks through the implementation details, including text rendering, rotation, and multi-page support.




Why...