[poppler] Q: how to extract form element trigger events

Albrecht Dreß albrecht.dress at posteo.de
Tue Aug 8 16:03:10 UTC 2023


I use libpoppler-glib8 version 22.12.0-2+b1 on Debian Bookworm to read the structure of PDF documents and to extract some components from them.  However, I could not find a way to actually access trigger events e.g. from forms.

E.g. the attached PDF file has a form field which calls simple JavaScript functions for the focus in and out events and for input validation.  I tried the following:
* The list returned by `poppler_page_get_link_mapping()` does not contain any `POPPLER_ACTION_JAVASCRIPT` items.
* The list returned by `poppler_page_get_annot_mapping()` contains only a `POPPLER_ANNOT_WIDGET` (20) item, for which no corresponding `PopplerAnnot*` structure is defined – no idea what I should do with it.
* The form element, contained in the list returned by `poppler_page_get_form_field_mapping()`, does not have an associated `PopplerAction` (i.e. `poppler_form_field_get_action() == NULL`).  Only `poppler_form_field_get_additional_action(item, POPPLER_ADDITIONAL_ACTION_VALIDATE_FIELD)` properly returns a `PopplerActionJavascript`, containing the correct script.

Unfortunately, I have no idea how I can access the actions related to the focus in and out events (and probably all others defined in PDF 32000-1:2008, section 12.6.3 “Trigger Events”).  Any insight will be highly appreciated!

Thanks in advance,
Albrecht.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Test.pdf
Type: application/pdf
Size: 21535 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/poppler/attachments/20230808/a8ac70d6/attachment-0001.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/poppler/attachments/20230808/a8ac70d6/attachment-0001.sig>


More information about the poppler mailing list