5

The settings in print to file option in Ubuntu is limiting and dangerous. All the applications apart from Mozilla print to a file ~/output.pdf, this is dangerous as you can overwrite a previous print.

Edit: I have been informed you are asked whether you wish to overwrite, unlike in cups-pdf

Why can't applications use the title of the document, the filename or the page title of the web page?

What package and where are the settings of this print to file held. I would prefer it printing to the desktop if it cannot intuitively chose a filename, as when it arrives on the desktop it would be a visual reminder for me to change the filename.

Previously I did not use the print to file feature, as the cups-pdf didn't have these short comings. But the latest releases including 12.04 of cups-pdf has been botched and all text are converted to images before embedding them in the pdf. Making the PDFs useless as it prevents the selecting of text and the sharpness of the text is lost too. The bug has been reported for sometime now, https://bugs.launchpad.net/ubuntu/+source/cups-pdf/+bug/820820 and as usual been labelled as a wish list feature.

So my question is where in the system is the ~/output.pdf set?

so one can change it to the desktop.

pt123
  • 652

3 Answers3

2

There is currently a GnomeGoal dedicated to change this: https://live.gnome.org/GnomeGoals/PrintToFile

However as it looks now, not many Gnome Applications implement this yet.

lanoxx
  • 1,229
0

In general, I'm unable to confirm the premise of your question. When I use firefox or gedit, I'm able to set both the directory and the filename where the output of print to file is saved. I wonder if the problem you are seeing is specific to a particular application. I have never noticed the program behavior you mention.

If it is a general problem, then I'd suggest that there is something wrong and it may be appropriate to file a bug. How do I report a bug? may be helpful.

Nevertheless, to get to your question in bold. Each application can manage its print menu. The Libre suite seems to go for exporting a .pdf file over printing to a file. For gedit the answer is: ~/.config/gedit/gedit-print-settings. For a gnome application that prints to files ~/.config/application-name would be the first place I would look.

Here's mine:

gruber@gruber-precise-laptop:~$ cat ~/.config/gedit/gedit-print-settings 

[Print Settings]
number-up=1
reverse=false
print-pages=all
output-uri=file:///home/gruber/Documents/xyzzy.pdf
output-file-format=pdf
collate=false
printer=Print to File
page-set=all
scale=100
John S Gruber
  • 13,336
  • The filename should be preset using the web page title or the filename of the document. Gedit config doesn't have filename location in the settings file you mentioned.

    There must be a parent config file that is setting ~/output.pdf as the default filename and other applications are referring to it. It is also difficult when you don't know which package controls print to file.

    Filing bugs has become pointless in my experience.

    – pt123 May 26 '12 at 02:17
  • Fixed Edit : It is difficult to file a bug when you don't know which package controls print to file.

    Filing bugs has become pointless in my experience.

    – pt123 May 26 '12 at 02:23
  • I think you have run into a bug. The absence of that line in the gedit config is probably because you didn't/can't change the file name. Since it stays at the default gedit doesn't change the config. I think you should report problems with print to file against the package where you are experiencing the problem. It can be adjusted later if other packages are involved. If you want to include another, the gtk+2.0 source package builds files involved in providing the gnome library for the default print dialog. – John S Gruber May 26 '12 at 02:35
  • this was in mine, but I have upgraded Ubuntu from 10.10 to 12.04. I added your output-uri replacing it with my home directory/Desktop and it did not work.

    [Print Settings] cover-after=none print-at=now scale=100 reverse=false print-pages=all resolution=600 print-at-time= resolution-x=600 resolution-y=600 cups-job-sheets=none,none cups-job-priority=50 collate=false cups-Resolution=600dpi cover-before=none number-up=1 page-set=all cups-number-up=1 printer=PDF

    – pt123 May 26 '12 at 02:54
  • Edit: it is working after the first print. Gedit is remembering the last filename printed. This is better, it would be good if it can use the filename of the text file.

    Eye of Gnome is doing the same thing, remembering the last printed file you set.

    – pt123 May 26 '12 at 03:03
  • @JohnSGruber Do you know if I can set the Paper size via the gedit settings, too? I would like to change the default from Letter to A4. – JJD May 19 '13 at 14:40
  • @JJD I don't know about changing the paper size--does page size matter when printing to a file? I'd suggest that you post your query as a separate question. There's a .config/gedit/gedit-page-settings but it doesn't change or printing to a file and it contains various settings that I suppose would depend upon the paper size chosen. – John S Gruber May 20 '13 at 15:36
  • @JohnSGruber The page size matters for printing to a file if you want to create a PDF before transfering the file to a printer (e.g. via another computer). I will consider opening a separate question. – JJD May 20 '13 at 18:20
0

Here is an alternative, in case someone is still looking for it: http://forums.linuxmint.com/viewtopic.php?f=47&t=172796#p1009080

It provides separate printers for different output quality (different image resolutions, grayscale, etc.), asking you where to store the result. Default file name is based on web page name if printed from the browser, or the original file name otherwise. Works for printing to PDF from Wine applications as well.

It refers to Linux Mint, which is based on Ubuntu and so should work there, too.