Closed Bug 539426 Opened 15 years ago Closed 13 years ago

Print to file by default PostScript, other Gnome apps default to PDF

Categories

(Core :: Printing: Setup, defect)

All
Linux
defect
Not set
minor

Tracking

()

RESOLVED FIXED
mozilla9

People

(Reporter: otto, Assigned: t_arceri)

References

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; fi; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.30729)
Build Identifier: Gecko/20100106 Ubuntu/9.10 Firefox/3.5.7

The Mozilla/Firefox print dialog does not seem to work like the print
dialog in other Gnome applications:

Example:
1. In Firefox, the default file type is PostScript, while in Gedit it is PDF. (this bug report)
2. In Firefox the default file name is empty ".ps", while in Gedit it is
"print.pdf". (bug #485067)
3. In Firefox, the print dialog does not remember any settings unlike the
dialog in Gedit. If you for example choose in the Firefox dialog to make a
two-sided print, nothing of it is left when you restart Firefox. In Gedit every
change to any optio is saved - if you once choose to e.g. make a two-sided
print, all prints will be two-sided until the option is changed again.
4. The file dialog does not remember the folder last used (bug #454003)

In my opinion Firefox should implement the print dialog in the same way as
other Gnome/GTK apps do. The behaviour of e.g. Gedit is more correct and closer
to the principles for example described in the Gnome User Interface Guidelines.

Also I read the original Netscape's philosophy was "keep each dialog in the same state where it was last time".

Please make PDF the default file type or allow the dialog to remember the file type selected earlier.

I think PDF is a good default since it is a more common format than PostScript (I know that PDF includes PS, but from the regular users point of view they are not the same).

Reproducible: Always

Steps to Reproduce:
1. On newest Ubuntu, open a page with Firefox
2. Choose File > Print
3. Choose Print to File
Actual Results:  
Post Script is selected by default. For most users, it is really annoying. Since there is no way currently for the user to save a better default, they need to manually change the file type each time..

Expected Results:  
PDF would be a more sensible and user friendly default.

The bug 485067 is closely related, but not duplicate.
reporter, does this still fail when using Firefox 5 *beta* http://www.mozilla.com/en-US/firefox/channel/ or Firefox 4?
Whiteboard: [closeme 2011-06-19]
Yes, this is still present. I have a fresh install of Ubuntu 11.04 with Firefox 4.

Amazing that I'm the only one bothered by this. Does not anybody else print web pages as PDF files..?
Actually, now when I read up on this I can remember the history. While using Ubuntu 9.10 and Firefox 3.x the printing dialog was fine, but then in Ubuntu 10.04 and Firefox 3.6 it got broken.

I originally found a bug report about it and commented it at https://bugzilla.mozilla.org/show_bug.cgi?id=485067#c17

As I was asked to file new bug reports for the related notices I made, I filed this bug report and https://bugzilla.mozilla.org/show_bug.cgi?id=539427

Personally I though think they are all related to the same Firefox or GTK regression introduced in Ubuntu 10.04.
Oh and I almost forgot: yes, I looked through the list and did not find any new issues related to his. Bug 485067 is the main one and it seems to have several duplicates filed.
I've attached a patch that will make print to pdf default.
Attachment #560765 - Flags: review?(roc)
Also note this patch will resolve the bug https://bugzilla.mozilla.org/show_bug.cgi?id=485067 as a side affect
Comment on attachment 560765 [details] [diff] [review]
Patch to print to pdf by default

Review of attachment 560765 [details] [diff] [review]:
-----------------------------------------------------------------

How does this change the default format to PDF? Don't you need to change nsDeviceContextSpecGTK::GetPrintMethod as well?
Hi Robert,
          Thanks for taking a look at the patch so quickly. To answer your question, no nothing else needs to be changed.

The code that sets pdf to default is in nsPrintSettingsGTK.cpp this checks the extension of the string that I have changed: 

  if (StringEndsWith(nsDependentString(aToFileName), NS_LITERAL_STRING(".ps"))) {
    gtk_print_settings_set(mPrintSettings, GTK_PRINT_SETTINGS_OUTPUT_FILE_FORMAT, "ps");
  } else {
    gtk_print_settings_set(mPrintSettings, GTK_PRINT_SETTINGS_OUTPUT_FILE_FORMAT, "pdf");
  }

Maybe it could be improved so that the string is set to mozilla. rather than mozilla.pdf then the extension is attached in nsPrintSettingsGTK.cpp after the print setting is set.

Note: The whole setting of the extension in the application seems a bit messy and I've suggested an improvement to GTK here https://bugzilla.gnome.org/show_bug.cgi?id=657322
Comment on attachment 560765 [details] [diff] [review]
Patch to print to pdf by default

Review of attachment 560765 [details] [diff] [review]:
-----------------------------------------------------------------

I see, thanks.
Attachment #560765 - Flags: review?(roc) → review+
Assignee: nobody → t_arceri
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/0641651a7a57
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
This is not fixed. I have never seen Firefox default to PDF in the print dialog:

http://img11.imageshack.us/img11/6001/selection092.png

Is there an automated test for this?
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
This is fixed. Your problem is with stale preferences as reported here: https://bugzilla.mozilla.org/show_bug.cgi?id=691430
Status: REOPENED → RESOLVED
Closed: 13 years ago13 years ago
Resolution: --- → FIXED
I am the original reporter. I just installed a fresh Ubuntu 12.04 alpha with Firefox 8, and there the default filename is Mozilla.pdf, so I consider this bug fixed.

(Although I remember that in some early Firefox, the default file name was the tag <title>.pdf, which would be cool, but that is another feature request.)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: