Linux MS DOS discussions
 help / color / mirror / Atom feed
From: Jan Willem Stumpel <jstumpel@planet.nl>
To: "Alain M." <alainm@pobox.com>
Cc: dosEmu-list <linux-msdos@vger.kernel.org>
Subject: Re: Emulating a laser printer (was Epson Printing)
Date: Fri, 10 Nov 2006 11:18:28 +0100	[thread overview]
Message-ID: <455451F4.8040603@my.home> (raw)
In-Reply-To: <45524615.4050005@pobox.com>

Perhaps an even better way to make it work is:

1) Compile & install GhostPCL. This puts pcl6 in
   /usr/local/bin.
2) Put an executable script in /usr/local/bin:

#!/bin/bash
PREFIX="\eE\e9\e&l26A\e&a6L\e&k2G\e(s12H\e(10U"
SUFFIX="\eE"
TEMP=`mktemp -u /tmp/dosprint.XXXXXX`
cat > $TEMP
FILE_TYPE=`file $TEMP|sed -e 's/^.*:[ ]*//' -e 's/[ ].*//'`

case "$FILE_TYPE" in
        "HP")
                cat $TEMP
                ;;
        * )
                echo -e $PREFIX
                cat $TEMP
                echo -e $SUFFIX
                ;;
esac
rm $TEMP

3) Do not specify $_printer in ~/.dosemurc; specify
   $_printer_command:

"dosprint|pcl6 -dNOPAUSE -sDEVICE=pswrite -sOutputFile=- - |lpr"

This assumes that your system prints Postscript OK when it is just
piped to lpr. This has always been the case on my Linux systems,
but I've never used CUPS. Don't know if it works on CUPS systems.
Anyway, if this works, the user does not have to worry about
/etc/printcap or writing an input filter. Thanks much for this tip.

The dosprint filter just passes through any data which have been
formatted as HP PCL by a DOS program. For other data (like screen
prints, or things sent to the printer by means of the DOS "print"
command) first the PREFIX is sent, then the data, followed by the
SUFFIX. In the PREFIX (to be modified according to the user's
needs), the pitch is set to 12 chars/inch, the paper size to A4,
and the character set to PC DOS (so "box characters" get printed
OK). HP PCL codes can be found at several places on the Internet.

I suppose this still has to be tweaked a bit; I find that the top
margin is too big when printing "real" PCL.

Regards, Jan


  parent reply	other threads:[~2006-11-10 10:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-08  0:32 Epson Printing Alain M.
2006-11-08  8:03 ` Jan Willem Stumpel
2006-11-08 21:03   ` Emulating a laser printer (was Epson Printing) Alain M.
2006-11-09  8:10     ` Jan Willem Stumpel
2006-11-10 10:18     ` Jan Willem Stumpel [this message]
2006-11-10 18:23       ` 1.3.3 flashy screen and overactive keyboard Jamie McPherson
2006-11-21 17:55       ` jamie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=455451F4.8040603@my.home \
    --to=jstumpel@planet.nl \
    --cc=alainm@pobox.com \
    --cc=linux-msdos@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox