problem with certain pdf's

Kevin Ivory Ivory at SerNet.de
Fri May 19 06:13:21 PDT 2006


On 2006-05-18 22:01, Anonymous wrote:
> I am having difficulty printing certain pdf files on certain printers via cups.
> When going through cups the printer(s) both new Kyocera and older HP models refuse to print and the queue gets hung.

The original HP firmware for 4100 had quite a few problems with
PDFs that had been converted to PostScript. A firmware update did
help in some cases. (but not all)

> And when I try to send the file directly to the printer's 9100 port using netcat (i.e. nc ) various things can happen:
> 1) On the older HP 4050TN the printer prints a bit of it and then hangs requiring cancel job and reboot.
> 2) On the newer Kyoceras part of the document will print but not all of it.

Neither the HP nor the ordinary Kyoceras take PDF input directly.
PDF must be converted to PostScript first. Both printer types also take
PCL-input and that is one of the easiest methods of working around
your problem: Simply install print queues with PCL-conversion.
(using this method, even your example file prints all pages
 - after that comes a blank page and a ERROR: undefined message).

> On one printer I get the error message:
> --------------------------------------------------
> ERROR: syntaxerror
> OFFENDING COMMAND: --nostringval--
> 
> STACK:
> 
> -savelevel-
> --------------------------------------------------
> An example of the file is at
> http://www.aps.uoguelph.ca/~bszk/cupspykota-lj245-mfan-35598

That file is PostScript, not PDF. To find out if a different
conversion works better, you might try the different conversion
methods PDF->PS: 1. Adobe reader; 2. Ghostscript; 3. XPdf.
Cups internally uses an adapted version of XPdf.
Please keep in mind for the HP at least, this is probably a
firmware bug.

> Can anyone help with this?

here is copy of a cups-filter you can put in your filter directory.
After substituting the pdf-line in your /etc/cups/mime.convs with
application/pdf         application/postscript  33      pdftops-ours

this script will be used instead of the original. Its default is
to call the original cups converter, but you can use cups options
-o pdf=acro
-o pdf=gs
-o pdf=xpdf
to get other conversions than the original. You will have to
change the paths of the *bin variables to reflect your local
system. Sorry I didn't bother to translate the German comments
for this posting.

#!/bin/bash
# /usr/lib/cups/filter/pdftops-ours
# Es gibt drei Methoden PDF in PS umzuwandeln: cups=pdftops, acro, gs=pdf2ps.
# Die Ausgabe-Qualitaet unterscheidet sich. cups und acro fuehren manchmal zu
# HP "49.4C02 Service Error". Ausweg: gs oder PCL-Treiber.
# gs fuehrt bei Angabe weiterer Optionen zur Ausgabe leerer Seiten :-(
# 2001-10-22 ki Initialversion PDF -> PS Filter für CUPS mit Ghostscript
#   Das mit Cups gelieferte pdftops erzeugt PostScript, das beim
#   HP Laserjet 4100 DTN gelegentlich den "49.4C02 Service Error"
#   ausloest.
# 2002-01-11 ki Option -sPAPERSIZE=a4 (sonst verlangt HP Letter Papier)
# 2003-01-11 ki Bei Option book acroread verwenden (sonst nur leere Blätter)
# 2003-02-27 ki kompaktes Logformat, Cups pstops wieder Default
# 2006-01-13 ki xpdf ist neuer als cups-interne xpdf-Version: eigene Option
# Nur 5 Argumente kommen hier wohl nie vor. (getestet: lpr < t.pdf, lpr t.pdf)
case $# in
  5|6 ) ;;
  *   ) echo "Usage: $0 job-id user title copies options [filename]"; exit ;;
esac
DEBUG=0
# LOGDIR must be writable by user lp!
LOGDIR=/var/log/cups
acrobin="/usr/X11R6/bin/acroread"
#acrobin="/usr/local/Acrobat5/bin/acroread"
acroopt="-toPostScript -size a4"
cupsbin="/usr/lib/cups/filter/pdftops"
gsbin="/opt/ghostscript/bin/gs"
gsopt="-q -dLanguageLevel=2 -dNOPAUSE -dBATCH -dPARANOIDSAFER -sDEVICE=pswrite -sPAPERSIZE=a4 -sOutputFile=-"
xpdfbin="/usr/local/bin/pdftops"
xpdfopt="-paper A4"
if [ $DEBUG -ne 0 ]; then
  time=$(unset TZ;LC_TIME=de_DE date)
  log="$1 $0 $time \$#=$#\nuser: $2\ttitle: $3"
  [ "$4" -ne "1" ] && log="$log\ncopies: $4"
  [ "$5"  != ""  ] && log="$log\noptions: $5"
  [ "$#" -eq "6" ] && log="$log\nfilename: $6"
  echo -e "$log\n" >> $LOGDIR/cups.parameter
fi
case "$5" in
  *acro* )
    $acrobin $acroopt < "$6"
    ;;
  *pdf=gs* | *pdf=pdf2ps* )
    $gsbin $gsopt -f "$6"
    ;;
  *pdf=xpdf* | *pdf=pdftops* )
    $xpdfbin $xpdfopt "$6" -
    ;;
  * | *pdf=cups* )
    $cupsbin "$@"
    ;;
esac
### EOF --- cut here ---

-- 
   _             |  Kevin Ivory          |  Tel: +49-551-3700000
  |_     |\ |    |  Service Network GmbH |  Fax: +49-551-3700009
  ._|ER  | \|ET  |  Bahnhofsallee 1b     |  mailto:Ivory at SerNet.de
 Service Network |  37081 Goettingen     |    http://www.SerNet.de/




More information about the cups mailing list