% Copyright (C) 1989, 2000 Aladdin Enterprises. All rights reserved.
%
% This software is provided AS-IS with no warranty, either express or
% implied.
%
% This software is distributed under license and may not be copied,
% modified or distributed except as expressly authorized under the terms
% of the license contained in the file LICENSE in this distribution.
%
% For more information about licensing, please refer to
% http://www.ghostscript.com/licensing/. For information on
% commercial licensing, go to http://www.artifex.com/licensing/ or
% contact Artifex Software, Inc., 101 Lucas Valley Road #110,
% San Rafael, CA 94903, U.S.A., +1(415)492-9861.
% $Id: gs_statd.ps 9558 2009-03-15 22:42:53Z alexcher $
% This file provides statusdict, serverdict, and assorted LaserWriter
% operators, mostly for the benefit of poorly designed PostScript programs
% that 'know' they are running on a LaserWriter.
systemdict begin
% We make statusdict a little larger for Level 2 stuff.
% Note that it must be allocated in local VM.
.currentglobal false .setglobal
/statusdict 89 dict .forcedef % statusdict is local, sys'dict global
% To support the Level 2 job control features,
% serverdict must also be in local VM.
/serverdict 10 dict .forcedef % serverdict is local, sys'dict global
.setglobal
end
% Define various paper formats. The Adobe documentation defines only these:
% 11x17, a3, a4, a4small, b5, ledger, legal, letter, lettersmall, note.
% These procedures are also accessed as data structures during initialization,
% so the page dimensions must be the first two elements of the procedure.
/.setpagesize { /statusdict .systemvar begin .setpagesize end } bind def
userdict begin
% Page sizes defined by Adobe documentation
% Note: these executable arrays should all begin with two
% integers which are the width and height (see gs_setpd.ps).
/11x17 {792 1224 //.setpagesize exec} bind def % 11x17 portrait
/a3 {842 1191 //.setpagesize exec} bind def
/a4 {595 842 //.setpagesize exec} bind def
% a4small should be a4 with an ImagingBBox of [25 25 570 817].
/a4small /a4 load def
% b5 see below.
/ledger {1224 792 //.setpagesize exec} bind def % 11x17 landscape
/legal {612 1008 //.setpagesize exec} bind def
/letter {612 792 //.setpagesize exec} bind def
% lettersmall should be letter with an ImagingBBox of [25 25 587 767].
/lettersmall /letter load def
% note should be letter (or some other size) with the ImagingBBox
% shrunk by 25 units on all 4 sides.
/note /letter load def
% End of Adobe-defined page sizes
STRICT { (%END SIZES) .skipeof } if
% Other page sizes
% ISO standard paper sizes
/a0 {2384 3370 //.setpagesize exec} bind def
/a1 {1684 2384 //.setpagesize exec} bind def
/a2 {1191 1684 //.setpagesize exec} bind def
% /a3 {842 1191 //.setpagesize exec} bind def % defined by Adobe
% /a4 {595 842 //.setpagesize exec} bind def % defined by Adobe
/a5 {420 595 //.setpagesize exec} bind def
/a6 {297 420 //.setpagesize exec} bind def
/a7 {210 297 //.setpagesize exec} bind def
/a8 {148 210 //.setpagesize exec} bind def
/a9 {105 148 //.setpagesize exec} bind def
/a10 {73 105 //.setpagesize exec} bind def
% ISO and JIS B sizes are different....
/isob0 {2835 4008 //.setpagesize exec} bind def
/b0 /isob0 load def
/isob1 {2004 2835 //.setpagesize exec} bind def
/b1 /isob1 load def
/isob2 {1417 2004 //.setpagesize exec} bind def
/b2 /isob2 load def
/isob3 {1001 1417 //.setpagesize exec} bind def
/b3 /isob3 load def
/isob4 {709 1001 //.setpagesize exec} bind def
/b4 /isob4 load def
/isob5 {499 709 //.setpagesize exec} bind def
/b5 /isob5 load def
/isob6 {354 499 //.setpagesize exec} bind def
/b6 /isob6 load def
/jisb0 {2920 4127 //.setpagesize exec} bind def
/jisb1 {2064 2920 //.setpagesize exec} bind def
/jisb2 {1460 2064 //.setpagesize exec} bind def
/jisb3 {1032 1460 //.setpagesize exec} bind def
/jisb4 {729 1032 //.setpagesize exec} bind def
/jisb5 {516 729 //.setpagesize exec} bind def
/jisb6 {363 516 //.setpagesize exec} bind def
/c0 {2599 3677 //.setpagesize exec} bind def
/c1 {1837 2599 //.setpagesize exec} bind def
/c2 {1298 1837 //.setpagesize exec} bind def
/c3 {918 1298 //.setpagesize exec} bind def
/c4 {649 918 //.setpagesize exec} bind def
/c5 {459 649 //.setpagesize exec} bind def
/c6 {323 459 //.setpagesize exec} bind def
% U.S. CAD standard paper sizes
/archE {2592 3456 //.setpagesize exec} bind def
/archD {1728 2592 //.setpagesize exec} bind def
/archC {1296 1728 //.setpagesize exec} bind def
/archB {864 1296 //.setpagesize exec} bind def
/archA {648 864 //.setpagesize exec} bind def
% Other paper sizes
/flsa {612 936 //.setpagesize exec} bind def % U.S. foolscap
/flse {612 936 //.setpagesize exec} bind def % European foolscap
/halfletter {396 612 //.setpagesize exec} bind def
% minimum of a4 and letter (a4 width, letter length)
/pa4 {595 792 //.setpagesize exec} bind def
% Japanese postcard size, 100mm x 148mm
/hagaki {283 420 //.setpagesize exec} bind def
% /tabloid {792 1224 //.setpagesize exec} bind def % 11x17 portrait
% /csheet {1224 1584 //.setpagesize exec} bind def % ANSI C 17x22
% /dsheet {1584 2448 //.setpagesize exec} bind def % ANSI D 22x34
% /esheet {2448 3168 //.setpagesize exec} bind def % ANSI E 34x44
%END SIZES
end
currentdict /.setpagesize .undef
statusdict begin
% Define the pagetype values for the known page formats.
% The values for all but letter and note are arbitrary.
/.pagetypenames
[ /letter /note %do not change this line, needed by 'setpagetype'
/legal /lettersmall
/11x17 /ledger
/a4small /a3 /a4
STRICT { (%END SIZES) .skipeof } if
/a0 /a1 /a2 /a5 /a6 /a7 /a8 /a9 /a10
/archA /archB /archC /archD /archE
/b0 /b1 /b2 /b3 /b4 /b5 /b6
/c0 /c1 /c2 /c3 /c4 /c5 /c6
/flsa /flse /halfletter
/isob0 /isob1 /isob2 /isob3 /isob4 /isob5 /isob6
/jisb0 /jisb1 /jisb2 /jisb3 /jisb4 /jisb5 /jisb6
/pa4 /hagaki
%END SIZES
] cvlit readonly def
%%%%%% The following items were suggested by a user as useful.
% Permanent definitions
/ramsize 4194304 def
/hardwareiomode 0 def
/sethardwareiomode {pop} bind def
/softwareiomode 0 def
/setsoftwareiomode {pop} bind def
/dosysstart false def
/setdosysstart {pop} bind def
/allowjobreset true def
/setallowjobreset {pop} bind def
/defaultpaperfamily 0 def
/setdefaultpaperfamily {pop} bind def
/defaultpapertray 0 def
/setdefaultpapertray {pop} bind def
/defaulttrayswitch false def
/setdefaulttrayswitch {pop} bind def
% Tray and format selection
/11x17tray {/11x17 .uservar exec} bind def
/a3tray {/a3 .uservar exec} bind def
/a4tray {/a4 .uservar exec} bind def
/a5tray {/a5 .uservar exec} bind def
/a6tray {/a6 .uservar exec} bind def
/b4tray {/b4 .uservar exec} bind def
/b5tray {/b5 .uservar exec} bind def
/flsatray {/flsa .uservar exec} bind def
/flsetray {/flse .uservar exec} bind def
/halflettertray {/halfletter .uservar exec} bind def
/ledgertray {/ledger .uservar exec} bind def
/legaltray {/legal .uservar exec} bind def
/lettertray {/letter .uservar exec} bind def
% Per-job parameters
/paperfamily 0 def % 0 is US, 1 is European
/papertray 1 def
/setpapertray {statusdict exch /papertray exch put} bind def
/trayswitch false def % paperout feeds from another tray
% We don't implement the (undocumented by Adobe) papersize 'operator',
% because it's very awkward to make it interact properly with all the
% different ways of setting the paper size.
%/papersize {/letter true} bind def %