[cups.general] Controlling font and print quality for dot-matrix

Johannes Meixner jsmeix at suse.de
Wed May 11 01:28:15 PDT 2005


Hello,

On May 10 10:45 Tim Boring wrote (shortened):
> On Tue, 2005-05-10 at 08:58 +0200, Johannes Meixner wrote:
> > On May 9 14:27 Tim Boring wrote (shortened):
> > > We're using CUPS on a new Linux (SuSE Linux Enterprise Server
> > > v9) box
> > 
> > In this case you should have a support contract with Suse.
> 
> I bought a maintenance contract; is that considered the same thing as a
> "support contract"?

As far as I know "maintenance" means "get updated packages for example
to fix a security problem" but "support" means "get help to solve a
problem for example how to set up something".
The details depend on the particular contract in your particular case.
Please refer to the matching contact address which is related to your
particular contract for the details.


> > If plain ASCII text is sufficient, have a look at
> > http://portal.suse.com/sdb/en/2003/06/jsmeix_print-cups-filters.html
> 
> Okay, I've taken a look at this document on the SuSE portal.  My first
> thought is that this is quite a bit of work to get a simple plain-text
> dot-matrix printer to work.

The article is meant like a textbook to explain the whole stuff
step by step.
I recommend to work through it step by step and at the end
you will have a good understanding how filtering in CUPS works.
Then you will see that it is in fact easy to set up a plain-text-only
printer by using no PPD but only one simple "System V style interface
script", see
http://portal.suse.com/sdb/en/2003/06/jsmeix_print-cups-filters.html#ASCII
item 7.


> I can use recode to
> convert the ASCII text to printer-specific code, and it shows how to do
> this for IBM PC.  I take it this means IBM emulation mode, is that
> correct?

I think no.
recode "lat1..ibmpc"
does not create IBM printer-specific escape sequences.
It creates IBM PC - i.e. MS DOS - specific character encoding.
In particular it replaces "LF" (Unix like line break)
with "CR+LF" (IBM PC - i.e. MS DOS - like line break)
which is needed by many printers to print plain text.
Otherwise the staircase effect may happen:
first line
          second line
                     third line


> If so, what should I do if I need to use Epson emulation mode?
> We have all of our Oki dot-matrix printers set to Epson mode and our
> management app is sending escape sequences for report/invoice formatting
> based on Epson codes.  Is it simply a matter of using "lat1..epson"
> instead of "lat1..ibmpc"?

Use "recode -l" (see "man recode") to list the possible codings.
There is no "epson" because recode does not produce
printer-specific escape sequences.

If your application produces the right printer-specific code,
there is no need to do any filtering at all.
Neither the full featured CUPS filtering via PPD nor the simple
filtering via "System V style interface script".

If your application produces the right printer-specific code,
send it directly to the printer - i.e. use "raw" mode.

You can force "raw" mode in any case by the "raw" option:
lp -d <queue> -o raw file.prn

If you only need "raw" mode, set up only a "raw" queue, neither
specify a PPD nor specify a "System V style interface script":
lpadmin -p <queue> -v <URI> -E

In this case anything is sent as is directly to the printer.

But then any user can print tons of nonsense sheets with e.g.
lp -d <queue> my_nice_200_pages_OpenOffice.org_presentation.XML
To avoid this, a simple "System V style interface script" which
tests that the data is acceptable for the printer helps, see
http://portal.suse.com/sdb/en/2003/06/jsmeix_print-cups-filters.html#ASCII
item 7.

Another problem may occur when the application produces the right
printer-specific code but at the end a formfeed is missing to
eject the last sheet out of the printer.
Again a simple "System V style interface script" which sends
an additional formfeed at the end of a job helps, see
http://portal.suse.com/sdb/en/2003/06/jsmeix_print-cups-filters.html#ASCII


> Second, the printer that I'm testing with to get this set up is
> configured as a network printer using IPP.  How would I run the script
> to test the character conversion to send the output to a network printer
> instead an attached parallel printer (e.g. /dev/lp0)?

To send data as is to a printer use "raw" mode:
Script a | lp -d <queue> -o raw


Please have a look at the CUPS documentation
http://localhost:631/documentation.html
and our support database articles, in particular
http://portal.suse.com/sdb/en/2004/05/jsmeix_print-cups-in-a-nutshell.html
and
http://portal.suse.com/sdb/en/2004/08/jsmeix_print-from-version-to-version.html
and
http://portal.suse.com/sdb/en/2002/11/jsmeix_print-cups-options.html


Kind Regards
Johannes Meixner
-- 
SUSE LINUX Products GmbH, Maxfeldstrasse 5      Mail: jsmeix at suse.de
90409 Nuernberg, Germany                    WWW: http://www.suse.de/





More information about the cups mailing list