summaryrefslogtreecommitdiffstats
path: root/pdftool.pl
diff options
context:
space:
mode:
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);
}