With gs 8.15, setpagedevice fails with /invalidaccess, if currentglobal is true, when setpagedevice is called. I can reproduce that with e.g. true setglobal << /.HWMargins [ 4 25.4 div 72 mul dup dup dup ] >> setpagedevice With gs 8.14 and gs 8.30 beta, the above command did work. I searched the PLRM, but I could not find a restriction which explicitly prohibits calling the setpagedevice operator, when currentglobal is true.
I don't know why this was assigned to me. Reassigning to Ray.
I confirm that this bug exists in the current CVS version.
The error appears in pdfwrite device after the fix http://cvs.ghostscript.com/cgi-bin/viewcvs.cgi/cvs/ghostscript/gs/lib/gs_pdfwr.ps?r1=1.37&r2=1.38 http://cvs.ghostscript.com/cgi-bin/viewcvs.cgi/cvs/ghostscript/gs/lib/gs_setpd.ps?r1=1.23&r2=1.24 And propagates to all devices after http://cvs.ghostscript.com/cgi-bin/viewcvs.cgi/cvs/ghostscript/gs/lib/gs_pdfwr.ps?r1=1.38&r2=1.39 The immediate cause of the error is an attempt to put local OutputAttributes dictionary into a global dictionary. I have not figured out yet how global/local objects should play inside the page device machinery. So the real cause of the bug is still a mystery.
Bug still reproducible in Ghostscript 9.03
Commit 073f7be1671e7fa2dbbc75984e593d2279bb05d7 fixes this