$sudo apt-get install cups-pdf
Then add your new printer for PDF:
In Ubuntu menu, Click System -> Administration -> Printing
Click the Add button.

Select Generic CUPS-PEF, click Forward

It will start a search Dialog.

Select Generic and click Forward.

Simple accept the recommended setting: CUPS-PDF/Generic CUPS-PDF Printer[en]
![accept the recommended setting: CUPS-PDF/Generic CUPS-PDF Printer[en] accept the recommended setting: CUPS-PDF/Generic CUPS-PDF Printer[en]](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiA9wxcIsX1eb5P1CZqMnatR_I7BecK86jA-HmRF1nRk93sFFcw1Vw_vgMnEZ3MEDOuhu5p8qYl69EyQgjd5xQHAhGLD9NfIHzKJLhAi-bysnhM29mMILT5sU2CsRpqSK7QIXbsUgpD21M/s400/PDFprinter_05.png)
Click Apply

Finally, you can test it.


The output files will be saved in PDF folder under your HOME.