GNOME Bugzilla – Bug 705848
filename proposed for printing uses '%20' in place of spaces
Last modified: 2013-08-21 15:11:54 UTC
To see the problem: 1. Open a PDF file whose name contains spaces, e.g. 'one two three.pdf'. 2. Choose File->Print. 3. Select "Print to File". Evince will propose the filename $HOME/Documents/one%20two%20three.pdf. The spaces have been replaced by '%20'. This is distracting and unhelpful.
Created attachment 252125 [details] Screenshot of Evince proposing default name for Print to File option Hi, Adam I compiled evince from git master and tried to reproduce the issue but I could not. Evince proposes the default name for a file (through the Print to File option) as "output". Could you please confirm if you are still seeing this bug after compiling from git master? Thanks.
Sindhu, I still see this bug even after compiling Evince from git master. I'm running on Ubuntu 13.10 with GTK 3.9.10 and GLib 2.37.5. Not sure why we're seeing different behavior here.
Created attachment 252151 [details] [review] Patch for unescaping the filename for print-to-file Hi, I am being able to reproduce this bug, and I can trace it back to a commit a5e2a06 - "ev-window: set output basename for print to file". The commit helped in getting the actual filename there instead of 'output.pdf' which Sindhu is getting. However, we need to unescape the string as it uses the document's uri. I have attached a patch for the same.
Review of attachment 252151 [details] [review]: This solves the issue. Although, you must free the string returned g_uri_unescape_string() when is not longer needed. Otherwise, you will be leaking memory. You might want to use something like: char *unescaped_uri; [...] unescaped_uri = g_uri_unescape_string (output_basename, NULL); gtk_print_settings_set (print_settings, GTK_PRINT_SETTINGS_OUTPUT_BASENAME, unescaped_uri); g_free (unescaped_uri);
Created attachment 252170 [details] [review] Updated patch for unescaping the filename for print-to-file Hi gpoo, thanks for the quick review! I have updated the patch to accommodate your suggestion. I hope its better now. Thank you once again.
Review of attachment 252170 [details] [review]: The patch looks good to me. Let's see what Carlos says.
Comment on attachment 252170 [details] [review] Updated patch for unescaping the filename for print-to-file Pushed to git master, thanks.