diff options
Diffstat (limited to 'Master/tlpkg/tlgs/Resource/Init/gs_setpd.ps')
-rw-r--r-- | Master/tlpkg/tlgs/Resource/Init/gs_setpd.ps | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/Master/tlpkg/tlgs/Resource/Init/gs_setpd.ps b/Master/tlpkg/tlgs/Resource/Init/gs_setpd.ps index 0fc72300f39..8fa7c51df15 100644 --- a/Master/tlpkg/tlgs/Resource/Init/gs_setpd.ps +++ b/Master/tlpkg/tlgs/Resource/Init/gs_setpd.ps @@ -95,27 +95,41 @@ level2dict begin { % Since setpagedevice doesn't create new device objects, % we must (carefully) reinstall the old parameters in % the same device. - .currentpagedevice pop //null currentdevice //null .trysetparams + .currentpagedevice pop //null currentdevice //null + { .trysetparams } .internalstopped + { + //null + } if dup type /booleantype eq { pop pop } - { % This should never happen! + { SETPDDEBUG { (Error in .trysetparams!) = pstack flush } if - cleartomark pop pop pop + {cleartomark pop pop pop} .internalstopped pop + % if resetting the entire device state failed, at least put back the + % security related key + currentdevice //null //false mark /.LockSafetyParams + currentpagedevice /.LockSafetyParams .knownget not + {systemdict /SAFER .knownget not {//false} } if + .putdeviceparamsonly /.installpagedevice cvx /rangecheck signalerror } ifelse pop pop % A careful reading of the Red Book reveals that an erasepage % should occur, but *not* an initgraphics. erasepage .beginpage - } bind def + } bind executeonly def /.uninstallpagedevice - { 2 .endpage { .currentnumcopies //false .outputpage } if + { + {2 .endpage { .currentnumcopies //false .outputpage } if} .internalstopped pop nulldevice } bind def (%grestorepagedevice) cvn - { .uninstallpagedevice grestore .installpagedevice + { + .uninstallpagedevice + grestore + .installpagedevice } bind def (%grestoreallpagedevice) cvn @@ -204,8 +218,8 @@ level2dict begin mark % First put the device's default page size in slot 0 % This satifies those that have devices built with a4 as the default - 0 mark /PageSize currentdevice /PageSize gsgetdeviceprop .dicttomark - + 0 mark /PageSize /GetDeviceParam .special_op + not {/setpagedevice .systemvar /configurationerror signalerror} if .dicttomark % Only populate the other entries if we aren't FIXEDMEDIA FIXEDMEDIA not { statusdict /.pagetypenames get { @@ -624,7 +638,7 @@ SETPDDEBUG { (Rolling back.) = pstack flush } if { 4 index 3 1 roll .forceput } { 3 index exch .undef } ifelse - } .bind + } .bind executeonly % must be bound and hidden for .forceput 7 { % For PageSize only, just impose the request. 1 index /PageSize eq { pop pop 1 index /PageSize 7 put } |