File: gs-eps.1

package info (click to toggle)
texlive-doc 2007.dfsg.2-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 129,872 kB
  • ctags: 3,330
  • sloc: xml: 23,147; perl: 8,370; makefile: 843; sh: 352; lisp: 276; java: 159; python: 97; sed: 4
file content (40 lines) | stat: -rw-r--r-- 1,108 bytes parent folder | download | duplicates (2)
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
29
30
31
32
33
34
35
36
37
38
39
40
#! perl
#
# Usage: gs-eps epsfile <outputfile> <resolution> <device>
#
# Where: epsfile is the encapsulated postscript file
#        outputfile is the output file (the default name
#          is <basename epsfile>.<device>)
#        resolution is the output resolution (default=300)
#        device is the GS driver to use (default=pbm)

($epsfile,$outputfile,$res,$device) = @ARGV;

if (! $epsfile) {
  printf "Usage: gs-eps epsfile <outputfile> <resolution>";
  printf " <gsdriver>\n";
  printf "Note: parameters are positional.  To specify a";
  printf " driver, you\n";
  printf "must also specify an outputfile and resolution.\n";
  exit 1;
  }
    
$epsfile =~ tr/\\/\//; # translate \foo\bar -> /foo/bar

if (! -r $epsfile) {
  printf "Cannot read file: $epsfile\n";
  exit 1;
  }

if (! $res)         { $res = 300 }
if (! $device)      { $device = "pbm" }

if (! $outputfile ) {
  @pathname = split(/\//,$epsfile);
  $outputfile = $pathname[$#pathname];
  $outputfile =~ s/.eps$//;
  $outputfile = join(".", $outputfile, $device);
  }

printf "Converting $epsfile to $outputfile at ${res}dpi...\n";