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 169583 - PDF properties.
PDF properties.
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: general
0.1.x
Other Linux
: Normal enhancement
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks: 164843
 
 
Reported: 2005-03-08 10:34 UTC by Mephisto
Modified: 2005-06-04 09:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ev-document-info.h patch (1.10 KB, patch)
2005-05-21 20:34 UTC, Emil Soleyman-Zomalan
committed Details | Review
ev-poppler.cc patch (1.20 KB, patch)
2005-05-21 20:34 UTC, Emil Soleyman-Zomalan
committed Details | Review
ev-properties{c,h}, ev-window.c patch (9.60 KB, patch)
2005-05-21 20:35 UTC, Emil Soleyman-Zomalan
committed Details | Review
evince-properties.glade (32.91 KB, patch)
2005-05-21 20:36 UTC, Emil Soleyman-Zomalan
committed Details | Review
fix spacings, make resizeable, and make data labels selectable + ellipsised (12.12 KB, patch)
2005-06-03 20:06 UTC, Christian Persch
committed Details | Review

Description Mephisto 2005-03-08 10:34:30 UTC
Distribution/Version: Fedora Core Rawhide

PDF files contains properties like title, author, subject, creator, producer, etc
GPDF can display those (file -> properties), but Evince can't. I would like to
see this functionality added, cause it can be really useful in some cases.
Comment 1 Martin Kretzschmar 2005-03-08 10:46:03 UTC
This had been on the TODO for a while. But it seems like we never had a bug for
this. 
Comment 2 Michael Plump 2005-03-17 22:47:55 UTC
Well, 164843 encompasses this...
Comment 3 Marco Pesenti Gritti 2005-05-09 10:18:33 UTC
Emil is working on this, see mailing list posts.
Comment 4 Emil Soleyman-Zomalan 2005-05-21 20:33:27 UTC
I apologize for the length of time it took to get this functionality working
right. At the present, this patch just takes care of the PDF properties and not
the font properties.

Also, this set of patches is dependent on a large patch to Poppler found at
https://bugs.freedesktop.org/show_bug.cgi?id=3359.
Comment 5 Emil Soleyman-Zomalan 2005-05-21 20:34:05 UTC
Created attachment 46726 [details] [review]
ev-document-info.h patch
Comment 6 Emil Soleyman-Zomalan 2005-05-21 20:34:39 UTC
Created attachment 46727 [details] [review]
ev-poppler.cc patch
Comment 7 Emil Soleyman-Zomalan 2005-05-21 20:35:43 UTC
Created attachment 46728 [details] [review]
ev-properties{c,h}, ev-window.c patch
Comment 8 Emil Soleyman-Zomalan 2005-05-21 20:36:06 UTC
Created attachment 46729 [details] [review]
evince-properties.glade
Comment 9 Marco Pesenti Gritti 2005-05-31 10:00:28 UTC
+	/* If the XML file cannot be openend, throw an error */
+	if (xml == NULL) {

I think we can do with a g_return_if_fail here. Or if you prefer if + g_warning
so we avoid crash on non debug builds... A dialog seem eccessive and we should
translate it.

+	if (ev_document_security_has_document_security (EV_DOCUMENT_SECURITY
(document))) {
+		secured_document = "Yes";
+	} else {
+		secured_document = "No";
+	}

Should be _("Yes") and _("No") so that we translate them.

+	gtk_label_set_ellipsize (GTK_LABEL (title), PANGO_ELLIPSIZE_END);

Am I wrong or this means the label will not be showed at all? Should we set
max_chars? (things may be changed here since the last time I used this).

+	gtk_label_set_markup (GTK_LABEL (optimized), info->linearized);

Why set_markup here? I'd rather use set_text since we dont have control on the
content of pdf info and they are not going to contain markup anyway.

+/* Some buggy versions of gcc complain about the use of %c: 
+ * warning: `%c' yields  only last 2 digits of year in some locales.
+ * 
+ * This is a relatively clean one is to add an intermediate
+ * function thanks to the strftime(3) manpage
+ */

I havent looked at this in detail but... what about using %b like glib does?
(gdate.c)

+            dialog = ev_properties_new (ev_window->priv->document, GTK_WIDGET
(ev_window));
+            gtk_dialog_run (dialog);
+            gtk_widget_destroy (GTK_WIDGET (dialog));

Modal dialog strikes me as bad here, but we can fix this later.
Anyway, Bryan how do you think the dialog should behave? Maybe transient and
close it if the user load a different document while the dialog is open?
Comment 10 Marco Pesenti Gritti 2005-05-31 10:02:11 UTC
+GtkDialog *
+ev_properties_new (EvDocument	*document, 
+		   		   GtkWidget	*toplevel)

I think we should pass in EvDocumentInfo structure directly. I think it would
make the nautilus properties plugin easier.
Comment 11 Marco Pesenti Gritti 2005-05-31 10:11:36 UTC
>I havent looked at this in detail but... what about using %b like glib does?
>(gdate.c)

I'm on crack today, %b does something entirely different.
Let's keep that hack for now.
Comment 12 Marco Pesenti Gritti 2005-05-31 10:13:05 UTC
Actually, on what gccs is that problem reproducable? If it's just a warning and
not in recent gccs we could just ignore it (we should really build without
Werror out of maintainer mode if we arent already).
Comment 13 Marco Pesenti Gritti 2005-05-31 10:17:42 UTC
When you remove the failure dialog you can also remove the toplevel argument
from _new.
Comment 14 Marco Pesenti Gritti 2005-05-31 12:24:32 UTC
Hopefully last comment :) We need to respect the info fields... I guess we could
hide widgets if the info is not available. (should be easy to test using a ps
document instead of a pdf).
Comment 15 Martin Kretzschmar 2005-06-02 19:32:38 UTC
> Should be _("Yes") and _("No") so that we translate them.

Never add _("Yes") and _("No") into code without translator comments, lest you
want Welsh tranlators screaming at you (bug 118214)

Comment 16 Marco Pesenti Gritti 2005-06-03 17:59:08 UTC
Checked in with only a few of my comments addressed, so that it doesnt stay here
to bitrot (I had to work out conflicts already).

Good point Martin. (and I actually have to check that we really want Yes/No there)
Comment 17 Christian Persch 2005-06-03 20:06:52 UTC
Created attachment 47209 [details] [review]
fix spacings, make resizeable, and make data labels selectable + ellipsised

I copied the spacings from Epiphany, so I'm only 95% certain they're right, but
it's a marked improvement already.
Comment 18 Marco Pesenti Gritti 2005-06-04 07:22:40 UTC
Comment on attachment 47209 [details] [review]
fix spacings, make resizeable, and make data labels selectable + ellipsised

Excellent, thank you!
Comment 19 Marco Pesenti Gritti 2005-06-04 09:36:42 UTC
Ok, this should be basically done in cvs. I'm not sure what to do with
properties that the backend doesnt support. For now I'm just leaving the value
empty... Not sure if hiding them would be a better choice, Bryan?

Closing, if there are problems please post separate bugs.