MiscWorld

A MiscWorld Experience

Installing a PDF print server on Ubuntu Server

Installing a PDF print server on Ubuntu Server

This article was originally written for Ubuntu 7, but we now know it works for Ubuntu 10 as well – thanks Shooda!

  1. To start, install the CUPS service and CUPS-PDF files:
    apt-get install cupsys
    apt-get install cups-pdf
  2. Now configure CUPS to allow remote administration:
    nano /etc/cups/cupsd.conf

    Modify the port where CUPS listens from:

    Listen localhost:631

    to:

    Listen 631
    Listen /var/run/cups/cups.sock
    Listen 192.168.1.1:9100

    The 192.168.1.1:9100 address allows you to connect to CUPS using the server’s network interface (192.168.1.1) on port 9100. I chose that port because that is the default port for HP printers (you can use the default port 631).
    Also modify these options to match the ones here:

    # Show shared printers on the local network.
    Browsing On
    BrowseOrder allow,deny
    BrowseAllow all
    BrowseAddress @LOCAL
    
    # Default authentication type, when authentication is required...
    DefaultAuthType Basic
    DefaultEncryption Never
    
    # Restrict access to the server...
    <Location />
      Order allow,deny
      Allow all
    </Location>
    
    # Restrict access to the admin pages...
    <Location /admin>
      Order allow,deny
      Allow all
    </Location>
    
    # Restrict access to configuration files...
    <Location /admin/conf>
      AuthType Basic
      Require user @SYSTEM
      Order allow,deny
      Allow all
    </Location>

    What you just did was to allow remote administration from any computer on the network. The DefaultEncryption option was to avoid the error:

    426 - Upgrade Required when using the CUPS web interface
  3. Restart the CUPS service:
    /etc/init.d/cupsys restart
  4. Ubuntu 7 Only: To perform administrative task remotely CUPS will ask you for a password. So let’s allow CUPS to read the password file:
    adduser cupsys shadow
  5. Ubuntu 8 Only: AppArmor seems to cause a remote connection problem, so execute the following command to fix it
    sudo aa-complain cupsd
  6. It’s time to check you can access it from another computer. Open a web browser and type the following address:
    http://192.168.1.1:9100

    You should see the CUPS page.

  7. To add the PDF printer from the CUPS page click on Administration
    CUPS Administration
  8. Click on Add Printer
    Add Printer
  9. Type a name for your printer, for example PDFPrinter and click Continue
    Virtual Printer
  10. Ubuntu 7 Only: Select Virtual Printer (PDF Printer) and click Continue
    Virtual Printer
  11. Ubuntu 8 Only: Select Print into PDF File (Generic PDF file generator) and click Continue
  12. Select Raw and click Continue
    Make
  13. Select Raw Queue (en) and click Add Printer
    Model
  14. By now your print server is ready to accept conections. So let’s configure Windows. From the Add Printer Wizard select A network printer, or a printer attached to another computer.
  15. Select Connect to a printer on the Internet or on a home or office network and type:
    http://192.168.1.1:9100/printers/PDFPrinter

    where PDFPrinter is the name you assigned it some steps before.

  16. Following the recommendation of Joe Brockmeier, select the HP DeskJet 1200C/PS driver
  17. And now it’s time to send a test page!

Your PDF files will be under

/var/spool/cups-pdf/ANONYMOUS/

If you want to change that directory you can:

  1. Open your cups-pdf configuration file:
    nano /etc/cups/cups-pdf
  2. And change this line:
    AnonDirName /path/to/your/pdf/files

I recommend you to install the Apache Web Server to let users access their PDF files. You can do this by pointing AnonDirName to a subdirectory of Apache. Also you should configure a cron job to automatically delete jobs older than 1 hour or so. I want to thank Joe Brockmeier and metalhippyrich for their excellent pages on this topic.

Best Regards!

6 Comments so far

  1. Bodyc May 14th, 2009 11:53 pm

    Hi,
    I have already seen it somethere…
    Thanks
    Bodyc

  2. KrisBelucci June 2nd, 2009 6:29 am

    Hi, good post. I have been wondering about this issue,so thanks for posting. I’ll definitely be coming back to your site.

  3. Network PDF Print Server? - openSUSE Forums February 25th, 2010 4:03 pm

    [...] print job (RAW) and create a pdf, thus allowing us to be more GREEN. Using guides such as this: MiscWorld

  4. shooda May 26th, 2010 2:36 pm

    I know its been a long time since this article but if your on windows 7 x64 and need a driver to work you can choose the MS Publisher Color Printer and it works fine.

    You may need to use the windows update button to update the available printer drivers for this to be available.

    To improve print output you can also set the advanced printing defaults to force softfont download.

  5. shooda May 26th, 2010 2:36 pm

    And thanks to the OP for the article got me up and running on ubuntu server 10.0.4 :)

  6. ubuntu June 23rd, 2010 10:18 pm

    Many Thanks for sharing this info!!!

Leave a reply