เอามาจาก http://ubuntu.wordpress.com/2006/03/23/print-to-pdf-using-cups-pdf/
Print to PDF using cups-pdf March 23, 2006
Posted by Carthik in ubuntu.trackback
I have been looking for a solution to print any file to pdf using a pdf printer driver.
cups-pdf is the package I was looking for apparently. But unfortunately, this takes just a little setting up.
Install cups-pdf by using:
$sudo apt-get install cups-pdf
Edit /etc/cups/cupsd.conf and change the line that says:
RunAsUser Yes
to
RunAsUser No
Restart cupsys:
$sudo /etc/init.d/cupsys restart
Add a new printer (System->Administration->Printing) selecting the “Local Printer” “PDF Printer” option. In the next step choose “Generic Printer” and then used the “Postscript Color Printer (Ver 3)” driver.
Now you should be able to print to pdf by selecting the newly setup printer.
Cribs:
1) The output .pdf files are stored in your “Home” directory. I can’t find a way to change this output directory to something of my liking
2) The output files are named with pre-defined names (job_8-untitled_document.pdf is an example). It would have been nice to select a name while printing.
3) One shouldn’t have to edit the cupsd.conf file to enable printing! (I found that I might have to edit the configuration file by visiting the homepage of the package, and trying out what I did). At the very least, the README.Debian file for the package should have informed me of the need to edit the configuration file.
1. Andre - March 23, 2006
I use a somewhat different approach. When printing I substitute kprinter for lpr. This pops up the KDE print dialog, which includes an option to produce PDF. It doesn’t matter that I use GNOME instead of KDE, it still works fine. You need to install the kdeprint package to do this.
15. Brian - June 12, 2006
For those who like everything in once place, following method worked great for me on Dapper - Thanks for the tips!
In a terminal:
sudo apt-get install cups-pdf
(You can use synaptic to install cups-pdf too if you like)
sudo chmod +s /usr/lib/cups/backend/cups-pdf
In Gnome:
System > Administration > Printing
New Printer
Local Printer & Use A Detected Printer click on PDF Printer
Choose “Generic” as the manufacturer
Choose “postscript color printer rev3b”
Leave the driver set to “Standard (suggested)”
Too bad you can’t choose a name & location for it to save too, but at least it’s in a sensible location (~/PDF)
Too bad this isn’t enables by default, I love KDE’s built-in PDF printer.