If I run these command lines: 1. cat /usr/share/system-config-printer/testpage-a4.ps | gs - 2. cat /usr/share/system-config-printer/testpage-a4.ps | /usr/bin/ps2pdf13 -dAutoRotatePages=/None -dAutoFilterColorImages=false -dNOPLATFONTS -dPARANOIDSAFER -sstdout=%stderr -dColorImageFilter=/FlateEncode -dPDFSETTINGS=/printer -dDoNumCopies - out.pdf I get the following error: GPL Ghostscript 8.71: ./psi/iscan.c(333): Can't refill scanner input buffer!GPL Ghostscript 8.71: Unrecoverable error, exit code 255 This happens after the frames are rendered (out.pdf contains only the frames). Supplying the input file directly on the command line (at the places where the single "-" are) they get correctly rendered. Ghostscript is version 8.71 on Ubuntu Lucid, 64-bit.
Created attachment 5982 [details] testpage-a4.ps Offending file: Ubuntu test page.
Problem is that the PS Interpreter tries to seek on the input file for certain files. A fix would be to avoid seeking under all circumstances, for example by reading bigger pieces into a buffer. A workaround is to never call Ghostscript with "-" as input file but always use "-_" instead. For this especially also all scripts which come with Ghostscript need to be fixed. See the attached ps2pdfwr as an example. The additional if [ "${infile}" = "-" ]; then infile="-_" fi solves the problem when any ps2pdf* script is used.
Created attachment 5983 [details] ps2pdfwr ps2pdfwr which uses "-_" instead of "-" in its Ghostscript call when input comes from stdin.
*** This bug has been marked as a duplicate of 690909 ***