Subversion Repositories planix.SVN

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
%
2
% Tries to round clipping path dimensions, as stored in array pagebbox, so they
3
% match one of the known sizes in the papersizes array. Lower left coordinates
4
% are always set to 0.
5
%
6
 
7
/roundpagebbox {
8
    7 dict begin
9
	/papersizes [8.5 inch 11 inch 14 inch 17 inch] def
10
 
11
	/mappapersize {
12
		/val exch def
13
		/slop .5 inch def
14
		/diff slop def
15
		/j 0 def
16
 
17
			/i exch def
18
			papersizes i get val sub abs
19
			dup diff le {/diff exch def /j i def} {pop} ifelse
20
		} for
21
		diff slop lt {papersizes j get} {val} ifelse
22
	} def
23
 
24
	pagebbox 0 0 put
25
	pagebbox 1 0 put
26
	pagebbox dup 2 get mappapersize 2 exch put
27
	pagebbox dup 3 get mappapersize 3 exch put
28
    end
29
} bind def
30