All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Peća Nešovanović" <office.eleservice@gmail.com>
To: linux-msdos@vger.kernel.org
Subject: Re: How to redirect LPT1 output to a disk file?
Date: Tue, 28 Feb 2017 15:46:04 +0100	[thread overview]
Message-ID: <2353255.MhAOCmL183@linux-dell> (raw)


>
> # $_lpt1 = "lpr -l"
> # $_lpt2 = "lpr -l -P lpt2"
> # $_lpt3 = ""
> 
> # idle time in seconds before spooling out. Default: (20)
> 
> # $_printer_timeout = (20)
> 
> ##############################################################################
> 
> However, these lines are not at all clear to me.  What changes are needed so
> that lpt1 output goes to a disk file?


well, you could try to capture LPT output in file, convert to PDF and mail to yourself

/HOME/USERNAME/.dosemurc

----------------------
$_lpt1 = "tmpprn"
$_printer_timeout = (30)
----------------------



/USR/LOCAL/BIN/tmpprn

---------------------
#!/bin/bash
#
#
TMP1=`mktemp /home/$USER/epson.XXXXX` || exit 1
TMP2=`mktemp /home/$USER/outps.XXXXX` || exit 1
TMP3=`mktemp /home/$USER/pdf.XXXXX` || exit 1
#
date > ~/dt.txt
#
# write out data into TMP1
#
cat "$@" > $TMP1
cd /usr/local/bin
#
epsonps -q -ta4-12 -o$TMP2 $TMP1
gs -sDEVICE=pdfwrite -sPAPERSIZE=a4 -sOutputFile=$TMP3 -dBATCH -dNOPAUSE $TMP2 $
sleep 2
#
mv $TMP3 $TMP3.pdf
/usr/bin/mutt -a $TMP3.pdf -s "DOS PRINT" $USER@localhost < ~/dt.txt
#
sleep 2
#cleanup
rm -f $TMP1
rm -f $TMP2
rm -f $TMP3.pdf
rm -f ~/dt.txt
------------------------

Hope this lead you to right way



             reply	other threads:[~2017-02-28 14:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-28 14:46 Peća Nešovanović [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-02-27 22:32 How to redirect LPT1 output to a disk file? Roger House
2017-02-27 22:52 ` Stas Sergeev
2017-03-01 23:43   ` Roger House

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=2353255.MhAOCmL183@linux-dell \
    --to=office.eleservice@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.