Skip to content

pdf: support 'de facto' tooltip feature

Nelson Ben requested to merge BUG_tooltip_annots_aacid into master
Most pdf readers implement a tooltip feature by
showing the string content of 'TU' field of a
widget annotation that is not linked to any
form field.

Normally, widget annotations carry a reference to a
form field which are used together to implement the
different form widgets. But, the PDF spec does not
forbid standalone (i.e. not linked to any form field)
widget annotations, and the fact is they're been used
by most pdf readers to show a tooltip when the area
of that AnnotWidget is hovered.

According to issue reported files, 'pdfTeX' seems to
be one of the pdf producers incorporating this tooltip
feature.

The support for this feature has been recently been
added to poppler-glib with following api:

gchar*
poppler_form_field_get_alternate_ui_name (PopplerFormField *field)

so this commit uses that api to show tooltips on pdf's
that carry them. For that we add a new 'tooltip' field
to EvFormField and show it when hovering the field's
area and when tooltip is not empty.

Evince issue #842 (closed)

Poppler issue: https://gitlab.freedesktop.org/poppler/poppler/issues/34

Merge request reports