diff options
author | Alex Cherepanov <alex.cherepanov@artifex.com> | 2010-07-17 21:23:39 +0000 |
---|---|---|
committer | Alex Cherepanov <alex.cherepanov@artifex.com> | 2010-07-17 21:23:39 +0000 |
commit | 40dbafef3ace6843b57472a4141081cf04347f09 (patch) | |
tree | 662919b0fbe3383b5192cd26d6ab9d27b6c4957c /gs/Resource/Init/gs_init.ps | |
parent | 7553b455e599a790b3cd1d0190110542f627a161 (diff) | |
download | ghostpdl-40dbafef3ace6843b57472a4141081cf04347f09.tar.gz |
Re-implement handling of named page sizes to avoid dependence on
the definitions of compatibility operators (a4, letter, etc.)
in userdict. Bug 691458.
git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@11517 a1074d23-0009-0410-80fe-cf8c14f379e6
Diffstat (limited to 'gs/Resource/Init/gs_init.ps')
-rw-r--r-- | gs/Resource/Init/gs_init.ps | 61 |
1 files changed, 23 insertions, 38 deletions
diff --git a/gs/Resource/Init/gs_init.ps b/gs/Resource/Init/gs_init.ps index 354966049..9a2a5136a 100644 --- a/gs/Resource/Init/gs_init.ps +++ b/gs/Resource/Init/gs_init.ps @@ -1752,27 +1752,20 @@ defaultdevice % If the paper size is not specifed and the device defaults to % letter or A4 paper, select the DEFAULTPAPERSIZE. -systemdict /DEFAULTPAPERSIZE known not - { - % Use .defaultpapersize if it returns a known paper size - .defaultpapersize - { - false statusdict /.pagetypenames get - { - 2 index eq { pop true exit } if - } - forall - {systemdict exch /DEFAULTPAPERSIZE exch put} - {QUIET - { pop } - { (Unknown .defaultpapersize: ) print ==only (.) = } - ifelse - } - ifelse - } - if - } -if +systemdict /DEFAULTPAPERSIZE known not { + % Use .defaultpapersize if it returns a known paper size + .defaultpapersize { + statusdict /.pagetypeprocs get 1 index known { + systemdict exch /DEFAULTPAPERSIZE exch put + } { + QUIET { + pop + } { + (Unknown .defaultpapersize: ) print ==only (.) = + } ifelse + } ifelse + } if +} if systemdict /DEFAULTPAPERSIZE known systemdict /PAPERSIZE known not and systemdict /DEVICEWIDTH known not and @@ -1805,23 +1798,15 @@ systemdict /PAPERSIZE known systemdict /DEVICEWIDTH known not and systemdict /DEVICEHEIGHT known not and systemdict /DEVICEWIDTHPOINTS known not and -systemdict /DEVICEHEIGHTPOINTS known not and - { % Convert the paper size to device dimensions. - true statusdict /.pagetypenames get - { PAPERSIZE eq - { PAPERSIZE load - dup 0 get /DEVICEWIDTHPOINTS exch def - 1 get /DEVICEHEIGHTPOINTS exch def - pop false exit - } - if - } - forall - { (Unknown paper size: ) print PAPERSIZE ==only (.) = - } - if - } -if +systemdict /DEVICEHEIGHTPOINTS known not and { + % Convert the paper size to device dimensions. + statusdict /.pagetypeprocs get PAPERSIZE .knownget { + dup 0 get /DEVICEWIDTHPOINTS exch def + 1 get /DEVICEHEIGHTPOINTS exch def + } { + (Unknown paper size: ) print PAPERSIZE ==only (.) = + } ifelse +} if % Adjust the device parameters per the command line. % It is possible to specify resolution, pixel size, and page size; % since any two of these determine the third, conflicts are possible. |