File: normalize-eps.awk

package info (click to toggle)
hyperlatex 2.5-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 480 kB
  • ctags: 288
  • sloc: lisp: 2,291; sh: 180; makefile: 86; awk: 21
file content (28 lines) | stat: -rw-r--r-- 602 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#
# normalize-eps.awk, Rolf Niepraschk, 11/97, niepraschk@ptb.de
# translatete the boundingbox and added a pagedevice operator
# based on the perl script from the "LaTeX Graphics Companion" page 459
#
BEGIN {
  bbneeded = 1
}

{
  if ($1 == "%%BoundingBox:")
  {
    if (bbneeded)
    {
      bbneeded = 0
      width = $4 - $2; height = $5 - $3;
      xoffset = -$2; yoffset = -$3; 
      print $1 " 0 0 " width " " height
      print "<< /PageSize [" width " " height "] >> setpagedevice"
      print "gsave " xoffset " " yoffset " translate"
    }    
  }
  else print
}

END {
  print "grestore"
}