Adding scribble like anotations to evince

Hello. I would like to add polyline annotations to evince in order to scribble in documents with my pen tablet. I find that adding handwritten notes to pdf documents enhances my comprehension when reading professional text.

My plan of action is as follows:

  1. Add a new subtype EvAnotationPolyline. Done
  2. Add a new new annotation type button for adding polyline annotation. Meanwhile I will call the button Ink. Currently it is a “one shot button”, though it doesn’t make sense for ink annotations, as you don’t want to exit ink mode when you lift the stylus the first time!
  3. When in ink annotation mode, catch the mouse motion and add it to the annotation.

There are still open questions, e.g. how do you erase and undo?

One option would be to rewrite the annotation button row to make it into a rich toolbar with multiple tools, e.g. lines, circles, ellipses, undo button, set color, set underline type, etc. But that is certainly outside the scope of this project.

Is there any interest in this? Or is this outside the scope of evince? I’m aware of the xournal++ project which is doing something similar, but it is using its own file format instead of annotating pdf.

I’m looking for a PDF viewer with two things: Dark mode and pen annotations. If you add this, Evince has them both, so yes, I’d be interested :slightly_smiling_face:

It is within the scope of Evince. AFAIU, Xournal++ uses its own format because libpoppler-glib does not expose the ink annotation (among other annotation types). The steps would be enable the Ink annotation in poppler-glib, also popppler-glib-demo to show and/or experiment how to use the API.

Intuitively, I would say that an ink annotation comprises a group of strokes within a certain range of time. When you erase, you erase the group. Undo would work in a similar way.