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
|
#!/usr/bin/perl
# psmerge: use Ghostscript to merge PostScript files produced by same application and setup
#
# (c) Reuben Thomas 2012
# (c) Angus J. C. Duggan 1991-1997
# See file LICENSE for details.
use strict;
use warnings;
use File::Basename;
use Getopt::Std;
{
no warnings 'once';
$GetOpt::Std::STANDARD_HELP_VERSION = 1;
}
my $prog = basename($0);
sub usage {
print STDERR "Usage: $prog [-oOUT-FILE] FILE...\n";
exit 1;
}
our ($opt_o);
usage() unless @ARGV and getopts('o:');
$opt_o ||= '-';
exec +(qw(gs -q -dNOPAUSE -dBATCH -sDEVICE=ps2write), "-sOutputFile=$opt_o", '-f', @ARGV);
die "$prog: Couldn't find Ghostscript (is it installed?), or it failed\n";
|