summaryrefslogtreecommitdiffstats
path: root/pdftool.pl
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem.moulin@chalmers.se>2011-05-14 21:57:44 +0200
committerGuilhem Moulin <guilhem.moulin@chalmers.se>2011-05-14 21:57:44 +0200
commit6276095d9755110225acad11fa7ec75e8364e0f6 (patch)
tree3b5ab68731c7a02ba7b40511de0cc6044cab89ef /pdftool.pl
parent93d0abfb9737f417f437de83347629fc769bb726 (diff)
fixed bug with margins & nup=2
Diffstat (limited to 'pdftool.pl')
-rwxr-xr-xpdftool.pl16
1 files changed, 10 insertions, 6 deletions
diff --git a/pdftool.pl b/pdftool.pl
index 14cad52..57b4f60 100755
--- a/pdftool.pl
+++ b/pdftool.pl
@@ -55,7 +55,8 @@ The document will be treated as follows:
=over 4
-=item * Convert from PDF to PostScript (if necessary),
+=item * Convert from PDF to PostScript (if necessary, and only for
+smallest interval that contains all the selected pages),
=item * Select of the page range,
@@ -725,7 +726,7 @@ sub calc_specs {
$up = $pageno % $vert;
}
($orot,$erot) = ('L','R');
- $xoff = $margin + ($across+1)*$outwidth/$horiz - $hshift;
+ $xoff = ($across+1)*$outwidth/$horiz - $hshift;
} else {
if (defined $column) {
# column=1; leftright=1; topbottom=1;
@@ -736,14 +737,17 @@ sub calc_specs {
$across = $pageno % $horiz;
$up = $vert-1 - floor($pageno / $horiz);
}
- $xoff = $margin + $across*$outwidth/$horiz + $hshift;
+ $xoff = $across*$outwidth/$horiz + $hshift;
}
- $yoff = $margin + $up*$outheight/$vert + $vshift;
+ $yoff = $up*$outheight/$vert + $vshift;
push @ospecs, sprintf ("%d%s@%.3f(%.3f,%.3f)",
- $pageno, $orot, $scale, $xoff, $yoff);
+ $pageno, $orot, $scale,
+ $xoff+$margin, $yoff+$margin);
push @especs, sprintf ("%d%s@%.3f(%.3f,%.3f)",
- $n + $pageno, $erot, $scale, $outwidth-$xoff, $outheight-$yoff);
+ $n + $pageno, $erot, $scale,
+ $outwidth-$xoff+$margin,
+ $outheight-$yoff+$margin);
}
return (\@ospecs,\@especs);
}