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

RESOLVED FIXED in mozilla9



Printing: Setup
8 years ago
6 years ago


(Reporter: Otto Kekäläinen, Assigned: Timothy Arceri)



Firefox Tracking Flags

(Not tracked)



(1 attachment)



8 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; fi; rv: 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:

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* or Firefox 4?
Whiteboard: [closeme 2011-06-19]

Comment 2

6 years ago
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..?
Otto, do any of these issues match up to yours ...
Whiteboard: [closeme 2011-06-19]

Comment 4

6 years ago
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

As I was asked to file new bug reports for the related notices I made, I filed this bug report and

Personally I though think they are all related to the same Firefox or GTK regression introduced in Ubuntu 10.04.

Comment 5

6 years ago
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.


6 years ago

Comment 6

6 years ago
Created attachment 560765 [details] [diff] [review]
Patch to print to pdf by default

I've attached a patch that will make print to pdf default.


6 years ago
Attachment #560765 - Flags: review?(roc)

Comment 7

6 years ago
Also note this patch will resolve the bug 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?

Comment 9

6 years ago
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
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+


6 years ago
Assignee: nobody → t_arceri
Ever confirmed: true
Keywords: checkin-needed
Keywords: checkin-needed
Target Milestone: --- → mozilla9
Last Resolved: 6 years ago
Resolution: --- → FIXED

Comment 13

6 years ago
This is not fixed. I have never seen Firefox default to PDF in the print dialog:

Is there an automated test for this?
Resolution: FIXED → ---

Comment 14

6 years ago
This is fixed. Your problem is with stale preferences as reported here:
Last Resolved: 6 years ago6 years ago
Resolution: --- → FIXED

Comment 15

6 years ago
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.