Why won Ghostscript read piped PDF files?
Portable Document Format is a file format which contains forward and backward links. It is not a stream format like PostScript. You cannot pipe PDF files to the stdin of Ghostscript. Instead you must either give the PDF filename on the command line, or use it as the argument of the Ghostscript run command. Ghostscript 8.00 and later can read piped PDF by copying to a temporary file.