Change 'Print to File' default to PDF

Bug #684376 reported by Kayvee
42
This bug affects 8 people
Affects Status Importance Assigned to Milestone
Mozilla Firefox
Fix Released
Low
One Hundred Papercuts
Fix Released
Low
Timothy Arceri
firefox (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

I use the 'Print to File' option a lot. Almost all the time, I choose PDF as the file format for this purpose. I think this would be the case for a majority of the users too. Hence, I think the file format chosen by default in the 'Print to File' dialog should be PDF instead of PS.

Tags: likely-dup
Revision history for this message
In , Otto Kekäläinen (otto) wrote :

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.

Revision history for this message
Chris Wilson (notgary-deactivatedaccount) wrote :

I'm not sure this is even a bug as I am unable to replicate it. When I choose 'Print to File', PDF is selected by default.

Revision history for this message
Kayvee (vkkodali) wrote :

Did you try it in Firefox? I just noticed that the options are different in Firefox - I only see PDF and Postscript. Whereas, in Evolution and Chromium (1) the default is PDF and (2) the options are PDF, Postscript and SVG. Perhaps this is specific to Firefox?

Revision history for this message
Chris Wilson (notgary-deactivatedaccount) wrote :

I can confirm that PDF is selected by default in Chrome and Epiphany, but in Firefox PS is the default option. I have confirmed this as a papercut and marked it as affecting Firefox.

Changed in hundredpapercuts:
status: New → Confirmed
Changed in firefox:
status: New → Confirmed
Revision history for this message
Vish (vish) wrote :

I can confirm that the issue seems to be only with Firefox and not in evolution,gedit,..

Changed in firefox (Ubuntu):
importance: Undecided → Low
status: New → Confirmed
Changed in hundredpapercuts:
importance: Undecided → Low
Changed in hundredpapercuts:
status: Confirmed → Triaged
Revision history for this message
Micah Gersten (micahg) wrote :

I think there's another bug for this already. In addition, I'm not sure it qualifies as a papercut, but I'd have to see the upstream bug to confirm.

tags: added: likely-dup
Revision history for this message
Vish (vish) wrote :

@Micah , I think you are looking for Bug 488857 ? It is kinda similar to this one...

Revision history for this message
Chris Wilson (notgary-deactivatedaccount) wrote :

I don't think bug #488857 and this one are similar enough to be considered duplicates. That one deals with the default contents of the text field and this one is about the default file format that is chosen. That one will be a problem regardless of what format is the default and fixing that will not necessarily fix this.

Revision history for this message
In , Vseerror (vseerror) wrote :

reporter, does this still fail when using Firefox 5 *beta* http://www.mozilla.com/en-US/firefox/channel/ or Firefox 4?

Revision history for this message
In , Otto Kekäläinen (otto) wrote :

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..?

Revision history for this message
In , Vseerror (vseerror) wrote :
Revision history for this message
In , Otto Kekäläinen (otto) wrote :

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.

Revision history for this message
In , Otto Kekäläinen (otto) wrote :

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.

summary: - Change 'Print to File' default to PDF
+ Change 'Print to File' default to PDF (Firefox)
Changed in firefox:
importance: Undecided → Unknown
status: Confirmed → Unknown
summary: - Change 'Print to File' default to PDF (Firefox)
+ Change 'Print to File' default to PDF
Revision history for this message
Timothy Arceri (t-fridey) wrote :

Chris this is a Firefox issue why did you change the summary? Its up to the application to set the default file type to anything other than PDF. GTK by default already sets pdf as default, for some reason Firefox has chosen to override this. I have linked the appropriate bug upstream.
The summary as is implies that GTK is at fault here which is not the case, it is a Firefox issue.

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Because, adding "[Firefox]" in to the title of a bug which is reported against the Firefox package is completely redundant, and doesn't do anything other than make the title longer

Revision history for this message
Timothy Arceri (t-fridey) wrote :

I guess we will have to agree to disagree. I do not think it is redundant as the bug is also reported against the Hundred Papercuts project, and as it stands the summary helps identify bugs and the projects they belong to from the list of hundreds. I would think having a longer title is hardly an issue if it helps clarify a bug report to someone browsing the list of bug as I was when I can across it.

Changed in firefox:
importance: Unknown → Low
status: Unknown → New
Revision history for this message
In , T-fridey-r (t-fridey-r) wrote :

Created attachment 560765
Patch to print to pdf by default

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

Revision history for this message
In , T-fridey-r (t-fridey-r) wrote :

Also note this patch will resolve the bug https://bugzilla.mozilla.org/show_bug.cgi?id=485067 as a side affect

Revision history for this message
In , Roc-ocallahan (roc-ocallahan) wrote :

Comment on attachment 560765
Patch to print to pdf by default

Review of attachment 560765:
-----------------------------------------------------------------

How does this change the default format to PDF? Don't you need to change nsDeviceContextSpecGTK::GetPrintMethod as well?

Revision history for this message
In , Timothy Arceri (t-fridey) wrote :

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

Revision history for this message
In , Roc-ocallahan (roc-ocallahan) wrote :

Comment on attachment 560765
Patch to print to pdf by default

Review of attachment 560765:
-----------------------------------------------------------------

I see, thanks.

Changed in hundredpapercuts:
status: Triaged → In Progress
assignee: nobody → Timothy Arceri (t-fridey)
Revision history for this message
In , Dao (dao) wrote :
Changed in firefox:
status: New → In Progress
Changed in hundredpapercuts:
status: In Progress → Fix Committed
Revision history for this message
In , Bmo-edmorley (bmo-edmorley) wrote :
Changed in firefox:
status: In Progress → Fix Released
Revision history for this message
Bob-El (boblanctot) wrote :

Firstly, I too, would like to mention that print to PDF should be the default. I can't imagine for what purpose I'd want to print to Postscript. Who uses Postscript anymore?

Secondly, I fail to understand how this script is useful. What do I do with it? Print it to PDF??? Ha! Ha! Just kidding. But I'm not a programmer so it's all gobbledigook to me.

I did a search for a file called nsDeviceContextSpecG.cpp on my computer and it doesn't exist. At least, Search for Files didn't find it. And having a look at the links provided is of no use either. Where is this folder widget/src/gtk2/ located? Not in the filesystem root nor in my home folder.

So after searching for a solution to this problem (bug if you will), which, by the way, didn't originate with 11.04 (I've found it a source of annoyance for at least 2 years), for a couple of hours I am still no further than when I started.

Revision history for this message
Timothy Arceri (t-fridey) wrote :

Hi bob, the files you are looking for will not be on your computer. They are the source code used to build firefox itself. A fix has been commited to firefox and is targeted for firefox 9 so you will need to wait just a little bit longer for this bug to be resolved (i think december is the release date for 9)

Changed in hundredpapercuts:
milestone: none → precise-2-social-networking
Changed in firefox (Ubuntu):
status: Confirmed → Fix Committed
Revision history for this message
Timothy Arceri (t-fridey) wrote :

I dont have precise installed currently but this fix was scheduled for firefox9 by mozilla which precise currently runs the beta of. If anyone can confirm this change in firefox 9 beta on precise then this bug can be set to fix released. Otherwise I will try install precise on a virtual machine later tonight to confirm.

Revision history for this message
Timothy Arceri (t-fridey) wrote :

Confirmed fixed in Firefox 9

Changed in hundredpapercuts:
status: Fix Committed → Fix Released
Changed in firefox (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
In , daviddahl (ddahl) wrote :

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?

Revision history for this message
In , Timothy Arceri (t-fridey) wrote :

This is fixed. Your problem is with stale preferences as reported here: https://bugzilla.mozilla.org/show_bug.cgi?id=691430

Revision history for this message
In , Otto Kekäläinen (otto) wrote :

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.)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.