Skip to content

Add free text annotations to glib bindings.

lbaudin1 requested to merge lbaudin1/poppler-freetextglib:master3 into master

This branch adds glib bindings for free text annotations (in an attempt to fix a long standing issue with evince/papers not being able to add free text annotations, the corresponding MR is here https://gitlab.gnome.org/GNOME/Incubator/papers/-/merge_requests/298/pipelines?commit_id=da4e1c428727711001ddbe008487dd33231efba9 ).

The font management is definitively not very satisfying: in a previous version I used a PangoFontDescription for the bindings but that brought around another dependency. Please let me know if there is a better way.

Moreover, it seems that the font name is not saved in PDFs, so it is lost when a PDF is saved. This does not seem to be a binding-related problem (the Qt one has the same issue and as a consequence Okular does not recall which font is used by annotations when a PDF is reloaded). Therefore, I would rather solve this in a future merge request.

edit: it looks like I was wrong, base font name can be retrieved, see _poppler_annot_free_text_new. I am moderately confident about this since I am not an expert about fonts in PDFs. It may not work if the annotation was added by another PDF viewer (for instance Firefox uses "Helv" for "Helvetica", iOS "/Helvetica" etc.).

Edited by lbaudin1

Merge request reports