We need to install cups-pdf this software is designed to produce PDF files in a heterogeneous network by providing a PDF printer on the central fileserver. It is available under the GPL and is packaged for many different distributions or can be built directly out of the source files.
sudo apt-get install cups-pdf
You need to chnage the following file permissions
sudo chmod +s /usr/lib/cups/backend/cups-pdf
Configure CUPS for the PDF printer.
-- Select SYSTEM > ADMINISTRATION > PRINTERS > NEW PRINTER
-- Select LOCAL PRINTER
-- Use detected printer: PDF PRINTER
-- Select Print Driver:
-- Manufacturer: Generic
-- Model: Postscript Color Printer
-- Name: postscript-color-printer-rev3b
-- Click APPLY
When printing from any application, select the newly created postscript-color-printer-rev3b printer to generate PDF files.
Output files are stored in your home directory under /PDF subirectory.
To change the default location of the PDF output
Edit the /etc/cups/cups-pdf.conf file
gksudo gedit /etc/cups/cups-pdf.conf
and change to something like below
sudo /etc/init.d/cupsys restart