Fix for 687601, /undefined in PK

"Russell Lang" <[email protected]> Sun, 29 Aug 2004 18:03:39 +1000
Newsgroups gmane.comp.printing.ghostscript.patches
Message-ID <41321A7B.16374.C39C4E2@localhost>
Alex,

> Improve automatic PDF recognition in run operator. Following Acrobat
> Implementation Notes H.3.4.1 search first 1024 bytes for %PDF- string.
> Identify file as PDF if %PDF- is found but the file doesn't start with
> %! . Recognize %!PS-Adobe-N.n PDF-M.m but don't search for it yet.
> Make .peekstring return "() false" instead of /rangecheck for empty
> files.
> Fix bug 687601 from the customer 562

I've worked on this bit of the code in the past, so did a few checks.
Your code breaks with the following command line
  bin\gswin32c -dEPSCrop -dBATCH -sDEVICE=pngalpha -sOutputFile=out%02d.png - < examples/annots.pdf
The error is
  Error: /rangecheck in --.peekstring--
How many bytes are you allowed to peek?  I thought it was limited by 
the size of the stream buffer.  stdio via callbacks reads in 128 byte 
chunks.



Russell Lang                   [email protected]
Ghostgum Software Pty Ltd      http://www.ghostgum.com.au/