[bug-gs] ps2pdf dies after page 10
Rob Keena
rkeena3 at suspa-inc.com
Thu Jun 24 13:19:49 PDT 2004
I am using a collection of Linux utilities to create a PDF emailer. It will use samba to emulate a Windows printer, Ghostscript to convert a raw postscript document to a PDF, then mail it to the user.
I have everything up and running and it works great. That is, until you try to print a document that is larger than 10 pages. When you do, you get the first 10 pages like they should be, a blank 11th page then the following error on the 12th page:
ERROR: ioerror
OFFENDING COMMAND: .writecvp
STACK:
0
(%%[Page: 10]%%)
-filestream
Here is the script that I wrote to handle all of this. This script is run from Samba after the incoming PS file has been received.
#!/bin/bash
#
# John Bright, 2001, jbright at winfordeng.com
# Added on by Rob Keena, 2004, keenaro1 at msu.edu
# Define some date formats to be used later.
DATE=`date +%b%d-%H%M%S`
LOGDATE=`date +%c`
OUTDIR=/tmp
ps2pdf $1 $OUTDIR/$DATE.pdf
# Map $2 to the user's email address through our wonderful LDAP gateway
EMAIL=`/usr/bin/ldapsearch -x -h 172.16.200.12 -D cn=*SNIP*,ou=gr,o=suspa -w *SNIP* cn=$2 mail |grep mail:|sed -e 's/mail: //'`
# Email the PDF to the email address we found above
/usr/local/bin/mailpdf -d /etc/pdf-mailer-body -s "PDF Document you Printed" -u "$EMAIL" -f "$OUTDIR/$DATE.pdf"
# Do some logging so we can see usage
echo "$LOGDATE - User: $2 - Email: $EMAIL" >> /var/log/pdfserver.log
# Delete the PDF and PS document
rm $OUTDIR/$DATE.pdf
rm $1
The odd thing is if i change the scrcipt to save the incoming postscript (instead of deleting it) I can take the PS file, run the following command:
ps2pdf incoming.ps outgoing.pdf
and it works. It converts all the pages properly.
I don't know if that makes this a bug in ghostscript or not, but I can't see any difference in how it is run via the command line and how it is run in the script.
The script is run as the same user as samba which is nobody, if that helps.
Thanks for any help,
Rob Keena
More information about the bug-gs
mailing list