summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fresti.(none)>2010-09-21 22:45:28 +0200
committerGuilhem Moulin <guilhem.moulin@chalmers.se>2010-09-21 22:46:57 +0200
commitf1a89b02805dd2307bbf0dc29fe33319c6514f92 (patch)
tree17d090f927a8726d499a18edc664df24f519a3e8
initial commit
-rwxr-xr-xpdftool.pl49
1 files changed, 49 insertions, 0 deletions
diff --git a/pdftool.pl b/pdftool.pl
new file mode 100755
index 0000000..269825d
--- /dev/null
+++ b/pdftool.pl
@@ -0,0 +1,49 @@
+#! /usr/bin/perl
+
+use Getopt::Long;
+use warnings;
+use strict;
+
+Getopt::Long::Configure ("bundling");
+
+my $remote = 'graal';
+
+my $pdf2ps = 'pdftops';
+my $ps2pdf = 'ps2pdf';
+my $pscrop = 'psnup2.pl -s1 -l1';
+my $psnup = 'psnup';
+my $psbook = 'psbook';
+my ($zip,$zcat) = ('bzip2','bzcat');
+
+open(PAPERSIZE, "/etc/papersize")
+ or die "Couldn't read `/etc/papersize'";
+my $papersize = <PAPERSIZE>;
+chomp $papersize
+ or die "Couldn't read papersize";
+close PAPERSIZE;
+
+
+my $nup = 1;
+my $margin = 1;
+#TODO: units
+my $crop;
+my $book;
+
+GetOptions( "nup|n=i" => \$nup,
+ "1" => sub { $nup = 1 },
+ "2" => sub { $nup = 2 },
+ "4" => sub { $nup = 4 },
+ "8" => sub { $nup = 8 },
+ "crop|c" => \$crop,
+ "book|b" => \$book,
+ "margin|m=s" => \$margin );
+
+
+for (my $n = $nup; $n > 1; $n /= 2) {
+ die "nup should be a power of two"
+ unless $n % 2 == 0;
+}
+
+
+print $nup, "\n";
+