Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Compiling ghostscript with the cupsomatic filter UNIX
Here's how to build Ghostscript to include new devices for printing with OS 10.2 CUPS printing system. The reason for building this is so you can use PPDs files with the cupsomatic filter. There are a lot of PPD device filters available at, but in order to use most of them you need ghostscript and the device (printer) you want to use compiled into the gs binary.

Some problems: Can't print from applications. Can print from lpr or by dropping files into the Print Center. I'm sure someone could shed some light on the reason why. So far I've printed a .rtf, .txt and .pdf using lpr or dropping the file to the printer in the Print Center to a Canon LBP8 using LPD on a UNIX server with success.

[Editor's note: I have not tested this one...]

You need the cupsomatic perl script. The cupsomatic script is available from here on the site. Once you have it, you need to set the Postscript to text converter command in the script but luckily OSX has "enscrpt" included. So you can set the enscript command to this or create a file /etc/foomatic/filter.conf with a line "textfilter: enscript" then copy the cupsomatic script file to /usr -> libexec -> cups -> filter and chmod 755. In your terminal type:
 % sudo cp cupsomatic /usr/libexec/cups/filter/
% sudo chmod 755 /usr/libexec/cups/filter/cupsomatic
Here's what you need to build ghostscript:
  • libpng source
  • zlib source
  • jpeg source
  • GNU ghostscript source
  • OS X Developer Tools
Links to the lastest libpng, zlib, jpeg and ghostscript can all be found on Download them all, then unzip ghostscript.tar.gz. Then unzip libpng, zlib and jpeg into the ghostscript folder and rename each of the unzipped folders to correspond with the names above.

Ghostscript has support for loads of devices but only a small few are compiled in by default. A list of all the devices included with ghostscript can be found in the files contrib.mak and dev.mak in the src/ directory in the ghostscript source distrbution or here on

It's way easy to include other devices. Just find the printer you're after in either dev.mak or contrib.mak then open which is located in the ghostscript root source tree and add that device to one of the DEVICE_DEVS lines. For example, if you were add support for a Canon LBP8 (not complied by default), just add "$(DD)" without the quotes to DEVICE_DEVS6. This is what it looked like by default:

DEVICE_DEVS6=$(DD) $(DD) $(DD) $(DD)

This is what its looks like after the addition of the LBP8 device:

DEVICE_DEVS6=$(DD) $(DD) $(DD) $(DD) $(DD)

Note that there are just spaces between the different devices. You can add as many as you like. The only problem will be increased compile time. On an iBook 500Mhz with 384M RAM, it took about 15 minutes to compile all the default devices plus one. Check out the README in ghostscript source for more information.

Now you're ready to compile it. Open a terminal if you haven't done so yet, change directory into the ghostscript folder and type:
 % ./configure
% make
% sudo make install
If all goes well, you should have a gs command installed into /usr -> local -> bin. Test if your device was compiled in by typing "gs --help" (if the command isn't found, it's because /usr/local/bin/ isn't in your PATH). It should also show up in the available devices.

Now you can go over to the driver list on and choose a printer and "Generate PPD file" for your printer. Save that file to your desktop as PrinterName.ppd. You now need to gzip the PPD file and mv it to /Library -> Printers -> PPDs -> Contents -> Resources -> en.lproj. So in a terminal type:
 % gzip PrinterName.ppd
% sudo cp PrinterName.ppd.gz
[The last command is shown on two rows; enter as one.]

You should now be able to open up Print Center and add your new printer. While holding down the Option key, click on "Add" then choose "Advanced" from the top drop down menu and set up your new printer.

Happy printing!
  • Currently 4.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)

Compiling ghostscript with the cupsomatic filter | 3 comments | Create New Account
Click here to return to the 'Compiling ghostscript with the cupsomatic filter' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Installer packages
Authored by: mclbruce on Oct 11, '02 11:07:41AM

I'm not a UNIX guru, so I may be out of my depth here. However, there is an OS X installer package for ghostscript:

This page also has an OS X installer for GIMP-print, which includes PPD files for many computers. I think installing both of these packages gives you all of the functionality mentioned in the above hint.

Both GIMP-print and GhostScript were mentioned in Phil Shiller's talk at Seybold SF recently. It's a pretty good overview to this subject:

[ Reply to This | # ]
Correction: GIMP-print PPD's
Authored by: mclbruce on Oct 11, '02 12:52:53PM

... are for printers, not computers. GIMP-Print contains many printer description files that work with CUPS and GhostScript.

[ Reply to This | # ]
non postscript / non cups
Authored by: marcweeber on Oct 24, '02 01:38:10PM

The combined approach works flawlessly: install a PPD from foomagic, install the cupsomatic filter, and install the Ghostscript from gimp-print. Then, everything works perfect. I now can IP print to my brother HL 1440 printer (from different macs thru an SMC barricade wireless router with print server). And not only the standard 300dpi accoording to normal cups pcl drivers, but up to the highest res of 1200x600!



[ Reply to This | # ]