78

Is there a way to install a printer that prints to pdf?

There's a lot of discussions about this in the web foruns, but none seens to work.

1
  • 1
    A more up to date answer can be found here
    – fbicknel
    May 8, 2018 at 18:50

3 Answers 3

118

If you've CUPS installed, you can easily add a "PDF Printer" by installing the cups-pdf package:

sudo apt-get install cups-pdf

or since Ubuntu 16.04

sudo apt-get install printer-driver-cups-pdf

The pdf printer provided by that package will "print" the resulting PDFs into the /home/[user]/PDF directory.

7
  • 24
    Since Ubuntu 16.04, the package is called printer-driver-cups-pdf.
    – sergej
    Jul 5, 2017 at 17:18
  • 1
    I get blank output files Dec 11, 2017 at 20:38
  • 3
    It can take a minute or so to complete "printing." So if you're getting blank pages or a "corrupted pdf," just give it a few minutes and check back later. May 8, 2018 at 3:09
  • 1
    since Ubuntu 18.04 the cups-pdf and its successor printer-driver-cups-pdf do not work any more. The "printer" disappears. Any idea how to print PDF from wine based apps?? Nov 5, 2018 at 23:01
  • 2
    Note that when using sudo apt install cups-pdf at least, the new "printer" that shows up in your print menu is called simply PDF, and when you select this printer and click the "Print" button, it then outputs the generated PDFs into this folder: ~/PDF, with a file name such as job_217-untitled_document.pdf. It took me a while to find them, as it looked like nothing was happening, and no dialog box came up (in typical Linux fashion: not very user-friendly!) Oct 14, 2019 at 22:22
25

Ubuntu ships with this functionality. Try opening gedit or another GUI text editor and clicking the print button:

enter image description here

When the Print dialog appears, select the "Print to File" printer and select a location for the PDF. After clicking Print, you should end up with a PDF file in that location containing an identical copy of what would have printed on a sheet of paper.

enter image description here

5
  • 6
    It's correct, the problem is with wine! Apps running under wine will not have access to this printer.. :( Nov 22, 2011 at 19:44
  • 3
    The cups-pdf printer is available also for applications running under wine.
    – tohuwawohu
    Nov 23, 2011 at 8:55
  • a lot of other image and text viewers and editors have this option
    – user47206
    Jun 7, 2012 at 15:55
  • 8
    This built in printer only shows up in certain applications... For example, it doesn't show up in Thunderbird or LibreOffice. Sep 14, 2015 at 9:45
  • Using this you have to be careful of not overwriting your last printed file. Jan 22, 2021 at 9:48
3

Whenever you print , there is already an option for "print to file". I hope you are talking about that.. if not then please elaborate your question

2
  • 2
    Yes, depending on the software you are using there's already this option. But for Astah UML, for example, there isn't. I would like something like the "print2pdf" software (this one, for Windows). Nov 22, 2011 at 19:28
  • Yes, this is independent from "print to file". apt-get install cups-pdf is back for a while. In Ubuntu 19 and 20 I could use it again. Works fine. mostly. Acts like a printer (same like the Redmond workaround). Feb 21, 2020 at 22:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .