Freehand Highlight Tool


We want to make a freehand text highlight tool, as far as I can see
there are currently 4 text highlight tools, none of which would
support a freehand drawing. Essentially the tool would be identical to
the freehand tool, only once applied it would be behind the text
instead of on top of it like the current Freehand tool.

Is this possible?


Creating a “FreeHand Highlight” tool is technically possible but
somewhat difficult. My recommendation would be to set the alpha value
of a standard freehand (ink) annotation to something less than 1,
which will not achieve an identical effect but perhaps it will be
close enough.

If you want to re-create the highlight look exactly, you will need to
modify the graphics state of the annotation’s content stream such that
it uses a multiply blend mode after it has been created. If the
annotation is changed (such as resizing the annotation), the content
stream will have to be re-modified, and if it is opened in another
viewer it will revert back to its original look if it is modified.
Please let me know if you would like further details on how to do this
if you are interested in taking this approach.

(A third approach would be to draw directly to the page content
stream, however implementing undo or moving/changing the freehand ink
afterwards would be difficult, so I don’t think that this would be
compatible with your app.)