Why Add Watermarks to Sensitive Documents?
When submitting identity cards, academic diplomas, or business financial records for verification, un-watermarked PDFs can easily be harvested and reused for unauthorized identity theft or contract tampering. Stamping a specific purpose watermark (e.g. "FOR VISA APPLICATION ONLY") visually and legally prevents secondary exploitation.
Canvas Vector-to-Raster Advantage for CJK Text
Client-side PDF engines typically struggle with CJK typography due to 20MB+ font payload requirements. Lucentool leverages the native HTML5 Canvas raster pipeline to render CJK characters directly in memory, embedding high-resolution transparent assets into the PDF with zero external font latency.
Tiled Anti-Tamper Grid Pattern
- Single center marks can be cropped: A solitary watermark placed in white space is vulnerable to manual digital removal.
- Full-coverage matrix: A repeating tiled grid intersects text, tables, and signatures, making any localized tampering immediately obvious.
Under the hood
loadPdfLib() fetches pdf-lib on first use, loadPdfFile() reads your file as an array buffer, and createWatermarkPngDataUrl() renders the watermark text onto a canvas once and converts it to a PNG data URL. That image is then embedded on every page at the chosen rotation, opacity and position, and the modified document is saved as a new file. Reusing one rendered image instead of drawing text per page is what keeps large documents manageable.
Formats, sizes and other limits
The watermark is rasterised, so it does not scale infinitely — at very high zoom the edges soften, and very small text loses legibility in print. Encrypted or permission-restricted PDFs cannot be modified and will fail to load. Rotated pages and unusual page sizes can place the mark off-centre, since the overlay uses page dimensions. Forms, bookmarks and signatures are not preserved through the rewrite.
Privacy: nothing is uploaded
The PDF is read through the local File API and rewritten in memory before download. There is no upload step and the site has no backend to receive the document.
Frequently asked questions
Will the watermark survive editing?
As a raster overlay it is part of the page content, so it cannot be selected and deleted like text — but it can still be painted over or cropped.
Why does my encrypted PDF fail?
pdf-lib cannot modify documents that require a password or restrict changes. Remove the restriction first, if you are entitled to.
Does it keep my form fields?
No. The rewrite flattens the document, so interactive forms and existing bookmarks are not carried over.