Bug 9011 - Incomplete printout
Incomplete printout
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: rhs-printfilters (Show other bugs)
6.1
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bernhard Rosenkraenzer
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-01-31 00:13 EST by Stephan C. Buchert
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-01-31 00:24:33 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Stephan C. Buchert 2000-01-31 00:13:38 EST
Symptom:

The printout is incomplete when sending raster images to a printer with
high resolution (eg 1200 DpI x 1200 DpI). The printer just stops printing
in the middle.

Cause:

The RH print filters, in this case specifically
/usr/lib/rhs/rhs-printfilters/ps-to-printer.fpi direct the output of
ghostscript to a temporary file (in /tmp). For high printer resolution
ghostscript produces easily very large (>70 MB) output, overflowing the /
file system.

Fix:

I changed the /usr/lib/rhs/rhs-printfilters/ps-to-printer.fpiscript such
that ghostscript pipes to the standard output instead of writing to a
temporary file. This seems to work fine. But I'm wondering whether there is
a reason why all these RH printer filters use temporary files?

Regards,

Stephan Buchert

PS: Here is my modified script
/usr/lib/rhs/rhs-printfilters/ps-to-printer.fpi:

#!/bin/sh
#
# convert ps to the format required by the printer on this queue
#
# if the printer is a PostScript printer, just cat it through
# if the printer uses ghostscript, we'll run it now
# if the printer is neither, we die (with good message to someone)
#
# Modified 2000/01/30 by scb@stelab.nagoya-u.ac.jp:
# ghostscript pipes now output directly to the standard output and doesn't
# use a temporary file.

#
# read in PostScript configuration settings
#
source ${SPOOLDIR}/postscript.cfg

#
# see if we should reverse order
#
# support will be added for this in the future
# psorder needed and is part of netatalk, which we dont currently ship
#

if [ "$PAPERSIZE" = "letter" ]; then
    mpage_paper="Letter"
elif [ "$PAPERSIZE" = "a4" ]; then
    mpage_paper="A4"
elif [ "$PAPERSIZE" = "legal" ]; then
    mpage_paper="Legal"
else
    mpage_paper="Letter"
fi

#
# weird case - some PS doesnt get handled by mpage well
# so we allow nup=1 to just cat PS to printer w/o mpage interferring
#
if [ "$NUP" = "1" ]; then
    border="-o"
    mpage_cmd="cat -"
else
    border=""
    mpage_cmd="mpage -b$mpage_paper $border -$NUP -m${RTLFTMAR}lr
-m${TOPBOTMAR}tb"
fi

#
# if the driver is
#  "POSTSCRIPT"    it means the printer handles Postscript natively,
#                  no need to run gs.
#  "TEXT"          it means the printer cannot handle PS input
#  "uniprint"      use the driver set by COLOR in postscript.cfg
#
if [ "$GSDEVICE" = "POSTSCRIPT" ]; then
   eval $mpage_cmd
elif [ "$GSDEVICE" = "TEXT" ]; then
   echo "Error - ps-to-printer.fpi - this printer cannot print postscript"
   echo "                            and ghostscript does not have support"
   exit 1
#
# Modified 2000/01/30 by scb@stelab.nagoya-u.ac.jp:
# ghostscript pipes now output directly to the standard output and doesn't
# use a temporary file.
#
#  We're using ghostscript with "uniprint" command line style,
#  $COLOR holds filename of driver parameters (filename.upp)
#  Since real driver name is stored in *.upp files, this style can
#  activate traditional drivers provided you create corresponding
#  *.upp files, entry to printdb, and compile ghostscript with uniprint.
#  ( Without compiling uniprint in ghostscript, this script will filter
#    out all uniprint entries in printdb including fake ones for
#    traditional drivers )
#
elif [ "$GSDEVICE" = "uniprint" ]; then
#  Set default *.upp driver (your default printer upp driver here)
   if [ "$COLOR" = "" ]; then
      COLOR="stcany"
      echo "No filename for parameters given.  Assume $COLOR."
   fi
#
   eval "$mpage_cmd | gs -q @$COLOR.upp \
      -sPAPERSIZE=$PAPERSIZE \
      -sOutputFile=- \
      $EXTRA_GS_OPTIONS -"
else
#  We're using ghostscript in traditional mannar

   eval "$mpage_cmd | sed \"s/[(]%%.*%%[)].*flush//g\" | \
      gs -q -sDEVICE=$GSDEVICE \
      -r$RESOLUTION \
      -sPAPERSIZE=$PAPERSIZE \
      -dNOPAUSE \
      -dSAFER \
      -sOutputFile=- \
      $COLOR \
      $EXTRA_GS_OPTIONS -"
fi

#
#
#   see if we need to send a form feed to eject the page from printer
#
    if [ "$PS_SEND_EOF" = "YES" ]; then
      printf "\004"
    fi

exit 0
Comment 1 Bill Nottingham 2000-01-31 00:24:59 EST
Fixed in the rhs-printfilters currently in Raw Hide; no temporary
file is used.

Note You need to log in before you can comment on or make changes to this bug.