Re: Emulating a laser printer (was Epson Printing)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Console]     [Linux Audio]     [Linux for Hams]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite Camping]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Samba]     [Linux Media]     [Fedora Users]

  Powered by Linux