GNOME Bugzilla – Bug 635055
Evince does not handle push buttons in PDF forms
Last modified: 2018-05-22 14:04:32 UTC
Downstream bug may be found at: https://bugs.launchpad.net/ubuntu/+source/evince/+bug/676401 Binary package hint: evince 1) lsb_release -rd Description: Ubuntu 10.10 Release: 10.10 2) apt-cache policy evince evince: Installed: 2.32.0-0ubuntu1 Candidate: 2.32.0-0ubuntu1 Version table: *** 2.32.0-0ubuntu1 0 500 http://us.archive.ubuntu.com/ubuntu/ maverick/main i386 Packages 100 /var/lib/dpkg/status apt-cache policy acroread acroread: Installed: 9.4-1maverick1 Candidate: 9.4-1maverick1 Version table: *** 9.4-1maverick1 0 500 http://archive.canonical.com/ubuntu/ maverick/partner i386 Packages 100 /var/lib/dpkg/status 3) What is expected to happen in the attached file (SST_20101101_Nov_2010.pdf) is when one clicks the link on page 12 "continue on page 31", the PDF immediately goes to page 31 in both evince & acroread. 4) What happens instead is that it goes to page 31 correctly in acroread but does not go anywhere in evince. ProblemType: Bug DistroRelease: Ubuntu 10.10 Package: evince 2.32.0-0ubuntu1 ProcVersionSignature: Ubuntu 2.6.35-22.35-generic 2.6.35.4 Uname: Linux 2.6.35-22-generic i686 Architecture: i386 Date: Wed Nov 17 02:55:14 2010 EcryptfsInUse: Yes InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release i386 (20101007) KernLog: ProcEnviron: LANG=en_US.utf8 SHELL=/bin/bash SourcePackage: evince
for me the link work fine, evince 2.32, can you add one example?
see one example in the launchpad ubuntu report in this link https://bugs.launchpad.net/ubuntu/+source/evince/+bug/676401/+attachment/1736025/+files/SST_20101101_Nov_2010.pdf where is the link?, page?
Fabio Durán Verdugo, thank you for addressing this bug. I attempted to attach the file but the GNOME bugzilla will not allow posting it due to file size restrictions. Despite that, if one downloads the PDF via: https://bugs.launchpad.net/ubuntu/+source/evince/+bug/676401/+attachment/1736025/+files/SST_20101101_Nov_2010.pdf goes to page 12, all the way towards the bottom, horizontally center, it has the link "continued on page 31". When I just tried to click it in Evince, it did nothing, but did go to page 31 correctly in acroread. If one cannot find this link, please use the Evince Find function via Ctrl+F and type in the search box "continued on page 31", as there is only one instance of it in the entire PDF.
Marking to Trivial. Confirmed issue downstream.
Created attachment 185824 [details] [review] libdocument: fix typos in ev-form-field.h
Created attachment 185825 [details] [review] libdocument: add form_field_get_link method to EvDocumentForms
Created attachment 185826 [details] [review] pdf: Implement form_field_get_link method of EvDocForms Interface.
Created attachment 185827 [details] [review] libview: handle actions associated to push buttons.
Carlos, these patches depend on the poppler_form_field_get_action method on the poppler_glib bindings that is new in poppler 0.18. I didn't know which approach to take: either to bump dependencies for 3.2 to 0.18? or to add test check for the api at configure time and use #ifdefs to check this. There is one glitch: If you apply these patches and the click on one of the buttons in the test-case, the cursor will transform from the "click me" cursor to the normal cursor, even if the cursor is inside the activation area of some button (moving the cursor a little bit gives you back the "click me" cursor) and I really don't know how to solve this.
Actually, for the test case here, there is also another bug, as the "continued on page 31" is a push form button with a Javascript action which just says "this.pagenum = 31", and since we don't support javascript yet, these patches do not make these links work just yet.
Review of attachment 185824 [details] [review]: Push it to master and gnome-3-2 branches. Thanks!
Review of attachment 185825 [details] [review]: Methods in EvDocumentForms interface are for forms properties that can be changed by the user. The aditional action should be part fo the EvFormField struct instance, since it's a readonly value common to all form fields.
Review of attachment 185826 [details] [review]: We don't need this either, just add a link attribute to EvFormField and add ev_field->link = poppler_form_field_get_action (poppler_field); to ev_form_field_from_poppler_field()
Review of attachment 185827 [details] [review]: ::: libview/ev-view.c @@ +2456,2 @@ if (EV_IS_FORM_FIELD_BUTTON (field)) { + if (EV_FORM_FIELD_BUTTON (field)->type == EV_FORM_FIELD_BUTTON_PUSH) { The action is not specific to push buttons, it's not even specific to button fields, it's common to all widget annotations, and should be triggered when the annotation is activated @@ +2463,3 @@ + ev_view_handle_link (view, link); + } else + field_widget = ev_view_form_field_button_create_widget (view, field); We should still create the widget even when there's an activation action.
Review of attachment 185827 [details] [review]: I meant needs-work here rather than rejected.
I can confirm this PDF does still not work with evince 3.6.1 and poppler 0.20.5.
Created attachment 235892 [details] [review] [PATCH] libdocument: Add activation_link to EvFormField struct libdocument/ev-form-field.h | 2 ++ 1 file changed, 2 insertions(+)
Created attachment 235893 [details] [review] [PATCH] libview: Handle activation link of a Form Field if present libview/ev-view.c | 3 +++ 1 file changed, 3 insertions(+)
Created attachment 235894 [details] [review] [PATCH] pdf: Add activation link for Fields that have it. backend/pdf/ev-poppler.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
Oh, I have forgotten to update these patches. Here are the three patches reworked according to the reviews.
Review of attachment 235892 [details] [review]: You should unref the link in the finalize.
Review of attachment 235893 [details] [review]: LGTM
Review of attachment 235894 [details] [review]: LGTM
Ok, I pushed the three patches, the first one with a g_clear_object line so we unref the link. Not closing as the remainding issues in the test case depend on javascript support.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/evince/issues/186.