Easy Watermark

AboutSeptember 2026

20· Software EngineeringActively maintained·Personal project

A browser-only tool that stamps a repeating, tiled watermark across every page of a PDF, with a live preview that provably matches the exported file, and no file ever leaving the browser.

web

Source ↗Live demo ↗

The appScreenshot
A 12-page PDF loaded with the default settings: 4 columns, 8 rows, a -45 degree diagonal, light gray text repeated edge to edge. Every control on the right is a slider paired with a numeric input on the same value.
Write-up

The documents people most need watermarked are the ones they least want to upload: contracts, ID scans, unreleased drafts, student records. Every convenient online PDF tool asks you to hand the file to someone else's server first, which for a document whose whole problem is that it is sensitive is the wrong trade. This one skips that step entirely. The file is loaded, watermarked and downloaded again without ever leaving the browser, since the same PDF library that reads it also writes the watermarked copy, all running locally. No hosting cost, no data-retention policy to write, nothing to breach.

The interesting engineering problem is making the watermark look right at any angle, density or page size, since a repeating diagonal pattern that covers a page edge to edge with no gaps or overlap takes real geometry rather than looping text across the page. The number of columns controls how wide each watermark instance is (fewer columns means bigger text), the number of rows controls how many diagonal repeats fit down the page, and both are worked out by rotating the page's dimensions into the watermark's own angle first, so the tiling maths stays a plain grid even on a steep diagonal. The same maths handles a sideways or landscape page correctly, watermarking it right-side up and edge to edge the way a PDF reader actually displays it, not the way the file happens to store it internally.

That tiling logic is one shared function used by both the live preview and the file export, so what is on screen while dragging a slider is provably what comes out the other end. It is covered by automated tests for tile count, font-size scaling and the geometry at a 45-degree diagonal, and the production build was checked specifically before going live rather than just the local dev version, since a couple of assets (the PDF renderer's background worker, the bundled fonts) are exactly the kind of thing that works on a laptop and breaks once deployed.

There is one deliberate exception to "nothing ever leaves the browser": a lightweight, anonymous page-view counter, added after the app was already working. It only knows a page was viewed, never what is inside a PDF or what watermark settings were used. It is called out here rather than left for someone to discover.

Things to underline
  • Built the watermark tiling math as one pure, tested function shared by both the live preview and the PDF export, so what's shown on screen is guaranteed to match the downloaded file
  • Handled rotated and landscape PDF pages correctly by computing the tiling against each page's true on-screen orientation, not its raw stored orientation
  • Embedded real, subsetted fonts into the exported PDF instead of flattening the text, so the watermark stays selectable and searchable in the output
  • Verified the deployed production build specifically, not just local development, catching the class of bug where an asset resolves locally but breaks once actually deployed
Built with
ReactTypeScriptpdf-libpdf.jsMantine
Live demo

■ [Notice]

This demo isn't loaded automatically, to save resources and avoid calling a third-party site on page load.

Open in a new tab ↗

Some sites block embedding. If the frame stays blank, use the link.