1

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 ?

PeterMmm
  • 895
  • 16
  • 28

1 Answers1

2

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).

symcbean
  • 19,931
  • 1
  • 29
  • 49