%PDF- %!PS-Adobe-3.0 % International paper sizes, version of 6 Sep 2015 % Author Dave Barber % e-mail xovimat@comcast.net % web http://tamivox.org/dave/IntlPaper/index.html % This program, in the Adobe PostScript language, draws a diagram of international paper sizes. % Submit it to Acrobat Distiller, Macintosh Preview or Unix pstopdf to make it run. % For greater elegance, change the name of this file from generic.txt to generic.ps % when you download it % You indicate the size of sheet to print on by setting GeneralSize, below. % The program draws the outlines of various sheet sizes, with suitable legends. % The .pdf file produced by the Distiller knows what size of paper to print on. % If you print it at that size, the diagram will be at 100% scale. % Most print drivers let you force it to some other scale. % We recommend that you modify this file with a text editor % (for instance Macintosh TextEdit, Microsoft Notepad, or Unix pico), % not a word processor % (for instance AppleWorks or Microsoft Word). % Define GeneralSize as one of the following integers, % to represent the size of sheet on which to print the chart. % -15: 8D0 -14: 8B0 -13: 8C0 -12: 8A0 % massive % -11: 4D0 -10: 4B0 -9: 4C0 -8: 4A0 % -7: 2D0 -6: 2B0 -5: 2C0 -4: 2A0 % huge % -3: D0 -2: B0 -1: C0 0: A0 % 1: D1 2: B1 3: C1 4: A1 % large % 5: D2 6: B2 7: C2 8: A2 % 9: D3 10: B3 11: C3 12: A3 % medium % 13: D4 14: B4 15: C4 16: A4 % 17: D5 18: B5 19: C5 20: A5 % small % 21: D6 22: B6 23: C6 24: A6 % 25: D7 26: B7 27: C7 28: A7 % tiny /GeneralSize 4 def % when in doubt, use 16 for size A4 % HowMany different sizes to show; it's any "reasonable" positive integer, % but if it's too big you'll run off the end of an array and get an error message. /HowMany 26 def %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Don't modify anything below this line unless you know something about PostScript. /Root 2.0 0.125 neg exp def /Power { Root exch exp 1000 mul } bind def /InfoScale 0.6 def % ------ paper size ------ /PageWideMM GeneralSize 2 add Power def /PageHighMM GeneralSize 2 sub Power def /PageWidePt PageWideMM 25.4 div 72 mul def /PageHighPt PageHighMM 25.4 div 72 mul def %%BeginFeature: << /PageSize [PageWidePt PageHighPt] >> setpagedevice %%EndFeature /LftMargin PageWideMM 0.5 2.0 -1.25 exp sub mul def /BotMargin PageHighMM 0.5 2.0 -1.25 exp sub mul def % ------ character strings for designators ------ /SmallDesig [ (A0) (D1) (B1) (C1) (A1) (D2) (B2) (C2) (A2) (D3) (B3) (C3) (A3) (D4) (B4) (C4) (A4) (D5) (B5) (C5) (A5) (D6) (B6) (C6) (A6) (D7) (B7) (C7) (A7) (D8) (B8) (C8) (A8) (D9) (B9) (C9) (A9) (D10) (B10) (C10) (A10) (D11) (B11) (C11) (A11) (D12) (B12) (C12) (A12) (D13) (B13) (C13) (A13) (D14) (B14) (C14) (A14) (D15) (B15) (C15) (A15) (D16) (B16) (C16) (A16) (D17) (B17) (C17) (A17) (D18) (B18) (C18) (A18) (D19) (B19) (C19) (A19) ] readonly def /LargeDesig [ (A0) (C0) (B0) (D0) (2A0) (2C0) (2B0) (2D0) (4A0) (4C0) (4B0) (4D0) (8A0) (8C0) (8B0) (8D0) ] readonly def /GetDesig { /Param exch def Param 0 gt { SmallDesig Param get } { LargeDesig Param neg get } ifelse } bind def % ------ manage colors ------ /ColorARed 0.40 def /ColorAGrn 0.25 def /ColorABlu 0.00 def /ColorBRed 0.80 def /ColorBGrn 0.00 def /ColorBBlu 0.00 def /ColorCRed 0.20 def /ColorCGrn 0.20 def /ColorCBlu 1.00 def /ColorDRed 0.00 def /ColorDGrn 0.60 def /ColorDBlu 0.00 def /Lighten { 1 exch sub 0.15 mul 1 exch sub } bind def /ColorADark { ColorARed ColorAGrn ColorABlu setrgbcolor} bind def /ColorBDark { ColorBRed ColorBGrn ColorBBlu setrgbcolor} bind def /ColorCDark { ColorCRed ColorCGrn ColorCBlu setrgbcolor} bind def /ColorDDark { ColorDRed ColorDGrn ColorDBlu setrgbcolor} bind def /DarkTable [ /ColorBDark load /ColorCDark load /ColorADark load /ColorDDark load ] def /ColorALite { ColorARed Lighten ColorAGrn Lighten ColorABlu Lighten setrgbcolor } bind def /ColorBLite { ColorBRed Lighten ColorBGrn Lighten ColorBBlu Lighten setrgbcolor } bind def /ColorCLite { ColorCRed Lighten ColorCGrn Lighten ColorCBlu Lighten setrgbcolor } bind def /ColorDLite { ColorDRed Lighten ColorDGrn Lighten ColorDBlu Lighten setrgbcolor } bind def /LiteTable [ /ColorBLite load /ColorCLite load /ColorALite load /ColorDLite load ] def % ------ format numbers ------ /Format4p0 { /Buffer (xxxx.) def /IParam Param 0.5 add cvi def /HeadStr (hhhh) def IParam HeadStr cvs pop Buffer 0 HeadStr putinterval Buffer } bind def /Format3p1 { /Buffer (xxx.y) def /IParam Param 0.05 add 10 mul cvi def /HeadStr (hhh) def IParam 10 idiv HeadStr cvs pop Buffer 0 HeadStr putinterval /TailStr (t) def IParam 10 mod TailStr cvs pop Buffer 4 TailStr putinterval Buffer } bind def /Format2p2 { /Buffer (xx.yy) def /IParam Param 0.005 add 100 mul cvi def /HeadStr (hh) def IParam 100 idiv HeadStr cvs pop Buffer 0 HeadStr putinterval /TailInt IParam 100 mod def TailInt 10 ge { /TailStr (tt) def TailInt TailStr cvs pop Buffer 3 TailStr putinterval } { /TailStr (t) def TailInt TailStr cvs pop Buffer 3 48 put Buffer 4 TailStr putinterval } ifelse Buffer } bind def /Format1p3 { /Buffer (x.yyy) def /IParam Param 0.0005 add 1000 mul cvi def /HeadStr (h) def IParam 1000 idiv HeadStr cvs pop Buffer 0 HeadStr putinterval /TailInt IParam 1000 mod def TailInt 100 ge { /TailStr (ttt) def TailInt TailStr cvs pop Buffer 2 TailStr putinterval } { TailInt 10 ge { /TailStr (tt) def TailInt TailStr cvs pop Buffer 2 48 put Buffer 3 TailStr putinterval } { /TailStr (t) def TailInt TailStr cvs pop Buffer 2 48 put Buffer 3 48 put Buffer 4 TailStr putinterval } ifelse } ifelse Buffer } bind def /FormatNo { /Param exch def Param 1000.0 ge { Format4p0 } { Param 100.0 ge { Format3p1 } { Param 10.0 ge { Format2p2 } { Format1p3 } ifelse } ifelse } ifelse } bind def % ------ draw one size of sheet ------ /DrawSheet { gsave % general % give the parameter a name /Factor exch def % what colors will we use? /Switch Factor 26 add 4 mod def % how big is this sheet? /FullWide Factor 2 add Power def /FullHigh Factor 2 sub Power def % how big is the next smaller sheet? /MiniWide Factor 3 add Power def /MiniHigh Factor 1 sub Power def % how wide will the dark stripe around each sheet be? /Edging FullWide 0.005 mul def % draw two boxes, a lite one on top of a dark one. % because the lite one is smaller, we get a dark border. DarkTable Switch get exec LftMargin BotMargin FullWide FullHigh rectfill LiteTable Switch get exec LftMargin Edging add BotMargin Edging add FullWide Edging 2 mul sub FullHigh Edging 2 mul sub rectfill % prepare text. the text location is based upon the next-smaller size sheet. DarkTable Switch get exec /DiffWide FullWide MiniWide sub def /DiffHigh FullHigh MiniHigh sub def /TextSize DiffWide 0.55 mul def /TextMargin DiffWide 0.18 mul def % display width in mm /Helvetica findfont TextSize scalefont setfont LftMargin FullWide add BotMargin FullHigh add translate /BufferC FullWide FormatNo def % BufferC stringwidth /WY exch def /WX exch def 180 rotate DiffWide TextMargin moveto BufferC show % display height in mm /BufferD FullHigh FormatNo def BufferD stringwidth /HY exch def /HX exch def 270 rotate DiffHigh neg HX sub TextMargin moveto BufferD show % display designator /Helvetica-Bold findfont TextSize scalefont setfont /Legend Factor GetDesig def Legend stringwidth /BY exch def /BX exch def BX neg TextMargin sub TextMargin moveto Legend show % legends Factor GeneralSize 2 add eq { FullHigh neg TextMargin add TextMargin moveto InfoScale dup scale 0.0 0.0 0.0 setrgbcolor /Helvetica-Bold findfont TextSize scalefont setfont (some international paper sizes) show } if Factor GeneralSize 3 add eq { FullHigh neg TextMargin add TextMargin moveto InfoScale dup scale 0.1 0.1 0.1 setrgbcolor /Helvetica findfont TextSize scalefont setfont (dimensions in millimeters -- ) show (measure to the outer edge of the border lines) show } if Factor GeneralSize 4 add eq { FullHigh neg TextMargin add TextMargin moveto InfoScale dup scale 0.2 0.2 0.2 setrgbcolor /Helvetica findfont TextSize scalefont setfont (for 100% scale, print this chart on a sheet of size ) show GeneralSize GetDesig show } if Factor GeneralSize 5 add eq { FullHigh neg TextMargin add TextMargin moveto InfoScale dup scale 0.3 0.3 0.3 setrgbcolor /Helvetica findfont TextSize scalefont setfont (http://tamivox.org/dave/IntlPaper/index.html) show } if grestore } bind def % ------ main routine ------ gsave % use a scale of millimeters, of course 72.0 25.4 div dup scale GeneralSize 2 add 1 GeneralSize HowMany 1 add add { DrawSheet } for showpage grestore