GNOME Bugzilla – Bug 169583
PDF properties.
Last modified: 2005-06-04 09:36:42 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.
This had been on the TODO for a while. But it seems like we never had a bug for this.
Well, 164843 encompasses this...
Emil is working on this, see mailing list posts.
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.
Created attachment 46726 [details] [review] ev-document-info.h patch
Created attachment 46727 [details] [review] ev-poppler.cc patch
Created attachment 46728 [details] [review] ev-properties{c,h}, ev-window.c patch
Created attachment 46729 [details] [review] evince-properties.glade
+ /* 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?
+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.
>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.
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).
When you remove the failure dialog you can also remove the toplevel argument from _new.
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).
> 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)
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)
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 on attachment 47209 [details] [review] fix spacings, make resizeable, and make data labels selectable + ellipsised Excellent, thank you!
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.