By: Joe ‘Zonker’ Brockmeier
Remember the paperless office? By now we were supposed to be handling all of our documents digitally, and saving trees by using computers to handle everything electronically. If you’d like to make backup copies of ephemeral content without printing it out, turn your Linux box into a PDF generation device for your entire network.
What sort of things might you want to save as PDFs? When you buy stuff online, virtually every site provides a receipt, which you may want later if the order email is lost or if you need to send in a receipt for expense reports. However, you may not want to print all of them out just to keep them around, and Firefox only supports writing to PostScript, rather than PDF.
What you’ll need is a Linux box with the Common UNIX Printing System (CUPS) and the CUPS-PDF driver. I set this up on Ubuntu Feisty, but it should work on any Linux distro with CUPS and the CUPS-PDF driver.
By default, CUPS-PDF is not installed, so grab it by using sudo apt-get install cups-pdf. You should then be able to add a fake printer that will convert print jobs to PDF files. Go to System -> Administration -> Printing to bring up the Printer configuration dialog. Select New Printer from the toolbar, and walk through the New Printer Wizard. You can give the printer pretty much any name you want. PDF seems like a logical choice. The Description and Location fields are optional.
On the next screen, when asked to select a connection, choose Virtual Printer, and leave the device URI as it is: cups-pdf:/. Next, on the screen where you can select a Printer from the database, choose Generic. On the next screen, choose PostScript as the Model and as the driver for the printer. Then you’ll see a screen that says “Going to create a new printer PDF at cups-pdf:/.” Click Apply and you should have a virtual PDF printer.
Now you should be able to create PDF files from most Linux apps by sending your print jobs to the PDF printer. When you send jobs to the printer, they’ll be saved to a directory under your home directory that’s named after the virtual printer — so if you choose PDF as the name of your virtual printer, then the jobs will be sent to /home/yourusername/PDF.
Most Linux apps are fairly well-behaved, but I’ve noticed that some jobs come through as zero-length files even though the applications don’t indicate any problems when printing. For example, Opera happily prints to the virtual printer, but the resulting jobs are empty files. Firefox and Thunderbird print to the virtual printer just fine.
Many GNOME and KDE apps now have the ability to print directly to PDF or export a file to PDF, so it’s not necessary to utilize the virtual printer. However, where the PDF printer comes in really handy is if you have one or more Windows machines on your network and you’d like to generate PDFs from Windows apps without spending the money on Adobe’s tools.
Read more at Linux.com