Share a PDF printer with your entire network using Ghostscript, Samba, and Linux.
Ghostscript lets you freely print to PDF. However, maintaining Ghostscript on every client in your enterprise can be a nuisance. Consider installing it on a single Linux server instead. Then, use Samba to share it as a PDF printer to your entire network.
Before creating a PDF printer server, install a local PDF printer to test Ghostscript and make sure it fits your requirements. Note that some Linux distributions provide GNU Ghostscript (Version 7) instead of the more recent AFPL Ghostscript (Version 8). Factor this into your testing. You will probably want to compile AFPL Ghostscript for your Linux server, later.
The Server
Every Linux distribution should have Samba and Ghostscript packages that you can install painlessly. Use them. Later, consider downloading and compiling the latest AFPL Ghostscript.
Samba is powerful, so its configuration requires some skill and patience. Consult man smb.conf and edit smb.conf to suit your network. Exercise your favorite Internet search engine, and drop by http://us3.samba.org/samba/docs/using_samba/toc.html. When things aren't working, consult the log files (e.g., /var/log/samba). Don't forget to restart the samba service (e.g., /etc/init.d/samba restart) after changing smb.conf.
Create the directory /home/pdf_printer/output, and chmod it to 777. This is where new PDFs will be delivered. Share this directory with your network by adding this section to smb.conf and restarting Samba:
[pdf_output]
comment = Shared PDF Printer Output
path = /home/pdf_printer/output
; this next line is necessary only when security = share
guest ok = yes
browseable = yes
writeable = yes
In Windows, this share should be visible from the Network Neighborhood or My Network Places. If not, try digging into Entire Network Microsoft Windows Network. Also try the Search for Computers or Find Computer features. Sometimes, new resources aren't visible immediately. Sometimes, client configurations must be reviewed and changed, too.
Now, let's add a PDF Printer to Samba. Once you get it working, adapt the settings to your requirements. Maybe these settings are all you will need.
Download samba-print-pdf from http://ranger.dnsalias.com/mandrake/samba/, copy it into your server's /usr/local/bin directory, and chmod it to 755. Open this script in an editor to see what it does, and possibly change things, such as its Ghostscript OPTIONS.
Add the following section to smb.conf. It should work with Samba's share security model (security = share) or user security model (security = user). The user security model requires that a user provide a name and password before accessing the printer.
[pdf_printer]
comment = Shared PDF Printer
path = /tmp
; this next line is necessary only when security = share
guest ok = yes
printable = yes
use client driver = yes
print command = /usr/local/bin/samba-print-pdf %s \
/home/pdf_printer/output //%L/pdf_output %m %I "%J" &
lpq command =
lprm command =
Restart Samba and then try accessing the file share pdf_output from a client machine. If that works, you are ready to install the client printer.
The Windows Client
Install the Virtual Printer Kit (VPK). Right-click our network printer, pdf_printer, under My Network Places in the File Explorer. Select Connect . . . , and click OK. The Add Printer Wizard will open and ask which printer driver to install. Click Have Disk, browse over to the VPK printer driver that suits your client platform, and click OK. Select the Virtual PostScript Printer driver and click OK. Your new PDF network printer will appear in the computer's Printers folder. Print a test page to make sure it works properly.
Later, copy these Virtual PostScript Printer files to the pdf_output share so that you can access them easily across your network.
Ghostscript lets you freely print to PDF. However, maintaining Ghostscript on every client in your enterprise can be a nuisance. Consider installing it on a single Linux server instead. Then, use Samba to share it as a PDF printer to your entire network.
Before creating a PDF printer server, install a local PDF printer to test Ghostscript and make sure it fits your requirements. Note that some Linux distributions provide GNU Ghostscript (Version 7) instead of the more recent AFPL Ghostscript (Version 8). Factor this into your testing. You will probably want to compile AFPL Ghostscript for your Linux server, later.
The Server
Every Linux distribution should have Samba and Ghostscript packages that you can install painlessly. Use them. Later, consider downloading and compiling the latest AFPL Ghostscript.
Samba is powerful, so its configuration requires some skill and patience. Consult man smb.conf and edit smb.conf to suit your network. Exercise your favorite Internet search engine, and drop by http://us3.samba.org/samba/docs/using_samba/toc.html. When things aren't working, consult the log files (e.g., /var/log/samba). Don't forget to restart the samba service (e.g., /etc/init.d/samba restart) after changing smb.conf.
Create the directory /home/pdf_printer/output, and chmod it to 777. This is where new PDFs will be delivered. Share this directory with your network by adding this section to smb.conf and restarting Samba:
[pdf_output]
comment = Shared PDF Printer Output
path = /home/pdf_printer/output
; this next line is necessary only when security = share
guest ok = yes
browseable = yes
writeable = yes
In Windows, this share should be visible from the Network Neighborhood or My Network Places. If not, try digging into Entire Network Microsoft Windows Network. Also try the Search for Computers or Find Computer features. Sometimes, new resources aren't visible immediately. Sometimes, client configurations must be reviewed and changed, too.
Now, let's add a PDF Printer to Samba. Once you get it working, adapt the settings to your requirements. Maybe these settings are all you will need.
Download samba-print-pdf from http://ranger.dnsalias.com/mandrake/samba/, copy it into your server's /usr/local/bin directory, and chmod it to 755. Open this script in an editor to see what it does, and possibly change things, such as its Ghostscript OPTIONS.
Add the following section to smb.conf. It should work with Samba's share security model (security = share) or user security model (security = user). The user security model requires that a user provide a name and password before accessing the printer.
[pdf_printer]
comment = Shared PDF Printer
path = /tmp
; this next line is necessary only when security = share
guest ok = yes
printable = yes
use client driver = yes
print command = /usr/local/bin/samba-print-pdf %s \
/home/pdf_printer/output //%L/pdf_output %m %I "%J" &
lpq command =
lprm command =
Restart Samba and then try accessing the file share pdf_output from a client machine. If that works, you are ready to install the client printer.
The Windows Client
Install the Virtual Printer Kit (VPK). Right-click our network printer, pdf_printer, under My Network Places in the File Explorer. Select Connect . . . , and click OK. The Add Printer Wizard will open and ask which printer driver to install. Click Have Disk, browse over to the VPK printer driver that suits your client platform, and click OK. Select the Virtual PostScript Printer driver and click OK. Your new PDF network printer will appear in the computer's Printers folder. Print a test page to make sure it works properly.
Later, copy these Virtual PostScript Printer files to the pdf_output share so that you can access them easily across your network.
3 comments:
Hi,
The tips about share a pdf network printer with samba is very informative for every software professional. To use the samba server you should have experience and practical knowledge, otherwise there is the risk. Thanks a lot.
Hi,
Nice and informative post. I appreciate the work done by author in this blog. Thanks for sharing this informative post.
Network Printer Setup
The tips about share a pdf network printer with samba is very informative for every software professional. To use the samba server you should have experience and practical knowledge, otherwise there is the risk.
what is a digital signature
Post a Comment