Skip to content

Document review

A review surface over a document: select text to highlight it, attach a callout comment, or write freehand in the margin. This is the shape a PDF or contract review interface takes. The annotations are vector objects carrying their own metadata, so an application can list them, filter them and store them next to the document rather than burning them into a picture.

Drawing with 18 elements on 2 layers. Text: Master Services Agreement. Text: 1. Scope of work. Text: The supplier shall provide the services described in each. Text: statement of work agreed between the parties. No change to. Text: the scope takes effect until both parties have signed a. Text: written amendment.. Text: 2. Fees and payment. Text: Invoices are due thirty days from receipt. Late payment. Text: accrues interest at two per cent per month, or the maximum. Text: permitted by law, whichever is lower.. Text: 3. Intellectual property. Text: All deliverables created under this agreement become the. Text: property of the customer on payment in full. The supplier. Text: retains ownership of pre-existing materials and grants a. Text: perpetual licence to use them within the deliverables.. Text: 4. Termination. Text: Either party may terminate for material breach on thirty. Text: days written notice if the breach is not remedied..
Each annotation carries a description, so the exported SVG and the accessible summary of the canvas both report what is on the page. That is how a canvas-based review tool stays usable with a screen reader: the strokes themselves cannot be described, but the objects around them can. The panel beside the page is ordinary HTML built from the same elements: ↗ selects an annotation on the page; × deletes it, and a comment's text is edited in its box, each as one undo step.

Highlights and callouts

A highlight is one or more rectangles drawn with multiply blending, so the text under it stays legible - the right element for marking text, because a line of text is a rectangle. A callout is a text box with a pointer to an anchor, the shape a review comment takes; the pointer leaves whichever edge of the box faces the anchor, so it stays sensible when the callout is moved. Both can be made directly, without a tool:

_document.AddElement(new BinkHighlightElement(lineRects)
{
    Color = BinkColor.Parse("#fde047"),
    Opacity = 0.5f,
    Description = "Highlighted: payment terms",
}, _annotationLayer);

_document.AddElement(new BinkCalloutElement(box: new BinkRect(320, 100, 200, 70), anchor: new Vector2(280, 130), text: "Please confirm this clause.")
{
    Style = new BinkShapeStyle { FillColor = BinkColor.Parse("#fff9c4"), StrokeColor = BinkColor.Parse("#785a00") },
}, _annotationLayer);

The contract is real text: each line is a BinkTextElement on a locked "Page" layer, so it is exported as text and read by a screen reader, while the review tools can only add to the "Annotations" layer above it. Export SVG writes both, with Title and the per-element descriptions.

Turning a box into a comment

The page listens to the document itself rather than to the canvas callback. That way the conversion - a dragged rectangle becoming a callout, a highlight gaining a description of the text under it - runs while the change is still being reported, and joins the same undo step: one undo removes a comment entirely instead of first turning it back into a plain box.

_document.Changed += OnDocumentEdited;

private void OnDocumentEdited(object? sender, BinkDocumentChangedEventArgs args)
{
    // Only fresh local edits are converted: undo and redo replay a conversion that already happened.
    if (args.Origin != BinkChangeOrigin.Local || args.Depth > 0) return;
    foreach (BinkAddElementOperation add in AddedElements(args.Operation))
    {
        if (add.LayerId == _annotationLayer) Convert(add.Element);
    }
}
An unhandled error has occurred. Reload 🗙