Flattened marks and PDF comments are not the same thing
A PDF can carry two very different kinds of markup. The first is an annotation object โ a comment, a sticky note, a highlight stored as metadata alongside the page. It stays editable, it can be replied to, and it can be deleted by anyone with a reader that exposes the annotation panel. The second is ink drawn into the page content itself, which is what this tool produces.
The distinction matters when you send the file to someone. Annotation objects render differently in different readers, disappear entirely in some print paths, and are stripped by a number of document management systems. A flattened mark is part of the page: it looks the same in Acrobat, Preview, Chrome and on paper, because there is nothing to interpret.
The trade is that a flattened mark cannot be un-flattened. Before you press download, the undo stack is thirty steps deep and nothing has been written to your disk. Afterwards, the mark is part of the page like any other line on it. If you need markup a colleague can reply to and delete, you want a reader that writes annotation objects, not this.
Why the page is not turned into a picture
The easy way to build a tool like this is to render each page to a bitmap, let the visitor paint on the bitmap, and rebuild the PDF from the result. It is a handful of lines of code and it is what a surprising number of free annotators do. It also destroys the document.
A rasterised page stops being searchable, stops being selectable, stops being readable by a screen reader, and grows โ often by a factor of five or ten, because a page of text stored as characters is far more compact than a photograph of that same text. You end up with a heavier file that does less, in exchange for a yellow rectangle.
So the marks here are written as drawing operators instead. A highlight is a filled rectangle in multiply blend mode, which darkens the words underneath rather than fogging them. A pen stroke is a run of line segments. A note is a box and a genuine string of Helvetica that you can select and copy out of the finished file. The original page content is copied across untouched.
Where a mark actually lands, and why that is the hard part
The thing most likely to be wrong in a browser annotator is the geometry, and it is wrong in a way that is easy to miss. You click on a page rendered at 140% zoom on a screen that reports two device pixels per CSS pixel; the file wants a position measured in points, counted upward from the bottom-left corner, in the pageโs own unrotated coordinate system. Three separate conversions sit between the click and the file.
The one that catches people is rotation. A page can store itself as portrait and carry an instruction telling the reader to display it turned ninety degrees โ very common in scanned documents, because sheet-fed scanners record the orientation the paper went through the feeder. Annotate that page with the obvious transform and the mark is placed against the stored page rather than the visible one. It looks correct on page one and lands on the wrong edge on page four.
Here a mark is never stored in pixels at all. The moment you release the pointer it becomes a fraction of the page you were looking at, and it stays a fraction until the file is written, at which point it is resolved once against the real page โ its real box, its real rotation. That is why zooming changes nothing, and why a rotated page behaves the same as an upright one.
What this will not do
It will not edit the words already on the page. Changing existing text in a PDF means finding the glyph run, matching the embedded font and re-flowing what follows โ a different operation with different failure modes, and drawing a white box over a sentence is not it.
It is not redaction. A highlight is drawn on top of the text, and the text is still there underneath: selectable, searchable and recoverable by anyone who opens the file in the right tool. Black bars applied this way have leaked more confidential material than almost any other document mistake. Real redaction has to remove the underlying content, not cover it.
And it does not write comment threads, stamps with author names, or review workflows. What it does is put a mark on a page, permanently, without sending the document anywhere โ which for reviewing a lease, correcting a proof or flagging a figure in a report is the whole job.