After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 635055 - Evince does not handle push buttons in PDF forms
Evince does not handle push buttons in PDF forms
Status: RESOLVED OBSOLETE
Product: evince
Classification: Core
Component: PDF
git master
Other Linux
: Normal normal
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on: 338721
Blocks:
 
 
Reported: 2010-11-17 08:36 UTC by Christopher M. Penalver
Modified: 2018-05-22 14:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
libdocument: fix typos in ev-form-field.h (1.62 KB, patch)
2011-04-12 19:15 UTC, José Aliste
committed Details | Review
libdocument: add form_field_get_link method to EvDocumentForms (2.30 KB, patch)
2011-04-12 19:15 UTC, José Aliste
rejected Details | Review
pdf: Implement form_field_get_link method of EvDocForms Interface. (1.78 KB, patch)
2011-04-12 19:15 UTC, José Aliste
rejected Details | Review
libview: handle actions associated to push buttons. (1.20 KB, patch)
2011-04-12 19:15 UTC, José Aliste
needs-work Details | Review
[PATCH] libdocument: Add activation_link to EvFormField struct (781 bytes, patch)
2013-02-13 15:29 UTC, José Aliste
committed Details | Review
[PATCH] libview: Handle activation link of a Form Field if present (767 bytes, patch)
2013-02-13 15:29 UTC, José Aliste
committed Details | Review
[PATCH] pdf: Add activation link for Fields that have it. (1.84 KB, patch)
2013-02-13 15:30 UTC, José Aliste
committed Details | Review

Description Christopher M. Penalver 2010-11-17 08:36:48 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
Comment 1 Fabio Durán Verdugo 2010-11-18 02:15:39 UTC
for me the link work fine, evince 2.32, can you add one example?
Comment 2 Fabio Durán Verdugo 2010-11-18 02:17:47 UTC
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?
Comment 3 Christopher M. Penalver 2010-11-18 20:23:57 UTC
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.
Comment 4 Christopher M. Penalver 2011-04-10 13:38:37 UTC
Marking to Trivial. Confirmed issue downstream.
Comment 5 José Aliste 2011-04-12 19:15:48 UTC
Created attachment 185824 [details] [review]
libdocument: fix typos in ev-form-field.h
Comment 6 José Aliste 2011-04-12 19:15:51 UTC
Created attachment 185825 [details] [review]
libdocument: add form_field_get_link method to EvDocumentForms
Comment 7 José Aliste 2011-04-12 19:15:54 UTC
Created attachment 185826 [details] [review]
pdf: Implement  form_field_get_link method of EvDocForms Interface.
Comment 8 José Aliste 2011-04-12 19:15:57 UTC
Created attachment 185827 [details] [review]
libview: handle actions associated to push buttons.
Comment 9 José Aliste 2011-04-12 19:31:03 UTC
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.
Comment 10 José Aliste 2011-04-13 07:06:32 UTC
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.
Comment 11 Carlos Garcia Campos 2011-10-17 16:25:30 UTC
Review of attachment 185824 [details] [review]:

Push it to master and gnome-3-2 branches. Thanks!
Comment 12 Carlos Garcia Campos 2011-10-17 16:32:41 UTC
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.
Comment 13 Carlos Garcia Campos 2011-10-17 16:35:06 UTC
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()
Comment 14 Carlos Garcia Campos 2011-10-17 16:41:24 UTC
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.
Comment 15 Carlos Garcia Campos 2011-10-17 16:50:00 UTC
Review of attachment 185827 [details] [review]:

I meant needs-work here rather than rejected.
Comment 16 Felix Möller 2013-01-27 22:22:29 UTC
I can confirm this PDF does still not work with evince 3.6.1 and poppler 0.20.5.
Comment 17 José Aliste 2013-02-13 15:29:49 UTC
Created attachment 235892 [details] [review]
[PATCH] libdocument: Add activation_link to EvFormField struct

 libdocument/ev-form-field.h | 2 ++
 1 file changed, 2 insertions(+)
Comment 18 José Aliste 2013-02-13 15:29:57 UTC
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(+)
Comment 19 José Aliste 2013-02-13 15:30:23 UTC
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(-)
Comment 20 José Aliste 2013-02-13 15:32:20 UTC
Oh, I have forgotten to update these patches. Here are the three patches reworked according to the reviews.
Comment 21 Carlos Garcia Campos 2013-02-18 16:35:15 UTC
Review of attachment 235892 [details] [review]:

You should unref the link in the finalize.
Comment 22 Carlos Garcia Campos 2013-02-18 16:36:41 UTC
Review of attachment 235893 [details] [review]:

LGTM
Comment 23 Carlos Garcia Campos 2013-02-18 16:40:26 UTC
Review of attachment 235894 [details] [review]:

LGTM
Comment 24 José Aliste 2013-02-18 17:09:11 UTC
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.
Comment 25 GNOME Infrastructure Team 2018-05-22 14:04:32 UTC
-- 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.