Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Our apllicatuion send ascii files to the printer. This application indicates with Ctrl-O at starting that the printer should print in 132 columns. I can define a printer pr01 for 80-col printing and pr01-132 for 132 col printing and set the default options accordingly.

lpoptions -p pr01-132 -o cpi=16.6 -o lpi=10

What i'm trying to do is when i send a job the spooler should take pr01-132 when the first char in the file is a Ctrl-O, otherwise pr01.

How can i do this with CUPS ?

share|improve this question
up vote 2 down vote accepted

Your application seems to be confused about whose responsibility it is to determine the rendering of the document. That it precedes the document with an SI character suggests that it is trying to control the rendering itself - [SI] selects condensed mode printing on an IBM DMP (required for 132 column printing in portrait layout). Assuming that your printer is configured and supports IBM emulation, then its simply a matter of setting up a new device in cups using the generic ASCII driver.

If your printers do not support IBM emulation, and the generic driver does not work as expected, then you'll probably need to strip the [SI] from the file. See this document for details of how to write your own filter. It describes the process for a DVI file - but the principle is the same: first invent a mimetype for your files, say application/vnd.local.proprinter, then set up a recipe for mapping the 'magic bytes' to the mimetype (see /etc/cups/mime.types) then write a script to strip the leading [SI] and convert to ps (man a2ps).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.