[reportlab-users] problem with pdf2ps
Mon, 1 Mar 2004 09:55 +0000 (GMT Standard Time)
Last November, Jade Meskill wrote:
> I am having trouble with some of my ReportLab generated PDFs. When I
> convert them to postscript using pdf2ps i get the following error:
> Error: /ioerror in --token--
> GNU Ghostscript 7.05: Unrecoverable error, exit code 1
> This is only happening in a few of my documents, and I can't seem to
> find a common thread between them. If I open them up in Preview on Mac
> OS X or in Acrobat Reader I can print it just fine, but printing using
> lpr on linux causes invalid postscript to be sent to the printer. Can
> someone give me a hint as to where I can look to see what is causing
> this error?
It's a long time ago, but there was no follow-up solution so you might
still like to know that this is probably caused by the character pair ~>
becoming split by a <CR><LF> in the pdf file, which produces the same
intermittent error when I convert pdf to png using GNU Ghostscript 7.06.
Strictly this is not allowed, although Acrobat reader accepts it and, now,
so does Ghostscript 8.1x but I don't think it has filtered down to GNU
Ghostscript yet. I guess an interim solution would be to pipe the pdf
through a Python script to strip out the offending characters.
Forestfield Software Ltd