PDF Printers for Every User

Once again this post will be pretty mundane to the typical enterprise Linux admin. I continue to post these projects because it highlights what can be done free software, plus I have worked out some kinks that others may run into.

If you couple parts of this post with how to join Ubuntu to an AD domain you have a simple scalable PDF printer for every user in the enterprise. We even discussed doing this at the Circus.

The last couple of days have been fun. I found out the Circus has been spending $30K per year on paper and toner, not to mention the two FTEs to print medical records out of our Electronic Medical Records (EMR). Then we paid those two ladies to scan that paper file back into a .pdf.

The worst part of this whole set up was that these ladies had first been told that printing to .pdf was just not possible. Then they were told that if we installed a new print system from our EMR, that would cost us $100K, we would be able to print to .pdf. I was appalled.

So I set up a cups-pdf printer and shared out the output directory through samba, asked for it to be set up like any other printer from the EMR and viola, .pdf medical records. The director and manger of medical records offered to buy me dinner and my CIO offered lunch. Not a bad couple of days of work. Not to mention the savings to the hospital, I’m guessing a ball park of $50K annually.

So here is how I did it. I forgot to mention that once they saw the first one, the decided they wanted two and then three. That added a little wrinkle but I’ll show you how I dealt with it.

I am using RHEL 5.3 but any CentOS will do, it’s even easier to setup on
Ubuntu. That’s where I did my proof of concept, but all of the extra stuff
I only did on Red Hat.

First add the users, these will be used to direct the pdf output to the correct directory. Also make sure to add both users to the lp group in /etc/group.

# useradd recordsaudit
# useradd recordsrelease
# useradd webrelease

Now make the ip addresses. I have two to make be able to print to two pdf printers because they will be used for different purposes.

eth1 == 192.168.1.10
eth1:1 == 192.168.1.11
eth1:2 == 192.168.1.12
[\code]

Next install the cups-pdf rpm, I used cups-pdf-2.4.6-1.el5.i386.rpm.
Edit the /etc/cups/cupsd.conf file to allow printing from your network.
Here is mine:

#
# "$Id: cupsd.conf.in 7199 2008-01-08 00:16:30Z mike $"
#
#   Sample configuration file for the Common UNIX Printing System (CUPS)
#   scheduler.  See "man cupsd.conf" for a complete description of this
#   file.
#
MaxLogSize 2000000000

# Log general information in error_log - change "info" to "debug" for
# troubleshooting...
LogLevel debug

# Administrator user group...
SystemGroup sys root

# Only listen for connections from the local machine.
Port 631
Listen /var/run/cups/cups.sock

# Show shared printers on the local network.
Browsing On

So here is how I did it. I forgot to mention that once they saw the first one, the decided they wanted two and then three. That added a little wrinkle but I'll show you how I dealt with it.

I am using RHEL 5.3 but any CentOS will do, it's even easier to setup on
Ubuntu. That's where I did my proof of concept, but all of the extra stuff
I only did on Red Hat.

First add the users, these will be used to direct the pdf output to the correct directory. Also make sure to add both users to the lp group in /etc/group.

# useradd recordsaudit
# useradd recordsrelease
# useradd webrelease

Now make the ip addresses. I have two to make be able to print to two pdf printers because they will be used for different purposes.
eth1 == 192.168.1.10
eth1:1 == 192.168.1.11
eth1:2 == 192.168.1.12

Next install the cups-pdf rpm, I used cups-pdf-2.4.6-1.el5.i386.rpm.
Edit the /etc/cups/cupsd.conf file to allow printing from your network.
Here is mine:

#
# "$Id: cupsd.conf.in 7199 2008-01-08 00:16:30Z mike $"
#
#   Sample configuration file for the Common UNIX Printing System (CUPS)
#   scheduler.  See "man cupsd.conf" for a complete description of this
#   file.
#
MaxLogSize 2000000000

# Log general information in error_log - change "info" to "debug" for
# troubleshooting...
LogLevel debug

# Administrator user group...
SystemGroup sys root

# Only listen for connections from the local machine.
Port 631
Listen /var/run/cups/cups.sock

# Show shared printers on the local network.
Browsing On
BrowseOrder allow,deny
BrowseAddress @LOCAL

# Default authentication type, when authentication is required...
DefaultAuthType Basic

# Restrict access to the server...
Order deny,allow
Deny From All
Allow From 127.0.0.1
Allow From All

# Restrict access to the admin pages...
Order allow,deny

# Restrict access to configuration files...
# to communicate with CUPS.
service jetdirect
{
socket_type = stream
protocol = tcp
wait = no
user = recordsrelease
server = /usr/bin/lp
server_args = -d recordsrelease -o raw
bind = 192.168.1.10
groups = yes
disable = no
}

service jetdirect
{
socket_type = stream
protocol = tcp
wait = no
user = recordsaudit
server = /usr/bin/lp
server_args = -d recordsaudit -o raw
bind = 192.168.1.11
groups = yes
disable = no
}

service jetdirect
{
socket_type = stream
protocol = tcp
wait = no
user = webrelease
server = /usr/bin/lp
server_args = -d webrelease -o raw
bind = 192.168.1.12
groups = yes
disable = no
}



To set up the printer, just set it up like any other HP jetdirect printer.  I
use the "HP Color LaserJet PS" printer in Windows.

To share out the output directory first add whatever user to samba:
smbpasswd -a username

Or check out how to add a Linux box to your Windows domain.

The interesting sections of my /etc/samba/smb.conf file:

# Printer configuration
printing = cups
load printers = yes

# The share for records
[audit]
comment = Cerner Printouts
path = /var/spool/cups-pdf/recordsaudit
public = no
writable = yes
printable = no
write list = +circus_user
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s