From 09da6d13d8eeb6dceb1452c5cbc276b58661c687 Mon Sep 17 00:00:00 2001 From: Jakob Haufe Date: Mon, 3 Jul 2017 21:22:12 +0200 Subject: [PATCH] Allow "blank" in pageorder to insert blank page --- pdfstitch | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/pdfstitch b/pdfstitch index 0608bc8..c7aa1a5 100755 --- a/pdfstitch +++ b/pdfstitch @@ -29,19 +29,21 @@ my $row = 1; foreach my $nr (@{$meta->{pageorder}}) { - my $xo = $outpdf->importPageIntoForm($inpdf, $nr); - - my ($llx, $lly, $urx, $ury); - $llx = $meta->{x} + $meta->{pageoffsets}->{$nr}->{x}; - $lly = $meta->{y} + $meta->{pageoffsets}->{$nr}->{y}; - $urx = $llx + $meta->{width}; - $ury = $lly + $meta->{height}; - $xo->bbox($llx, $lly, $urx, $ury); - - my $xpos = ($column - 1) * $meta->{width}; - my $ypos = $height - ($row * $meta->{height}); - print "Stitching page $nr at $xpos,$ypos...\n"; - $content->formimage($xo, $xpos, $ypos); + if($nr ne "blank") + { + my $xo = $outpdf->importPageIntoForm($inpdf, $nr); + + my ($llx, $lly, $urx, $ury); + $llx = $meta->{x} + $meta->{pageoffsets}->{$nr}->{x}; + $lly = $meta->{y} + $meta->{pageoffsets}->{$nr}->{y}; + $urx = $llx + $meta->{width}; + $ury = $lly + $meta->{height}; + $xo->bbox($llx, $lly, $urx, $ury); + + my $xpos = ($column - 1) * $meta->{width}; + my $ypos = $height - ($row * $meta->{height}); + $content->formimage($xo, $xpos, $ypos); + } $column++; if($column > $meta->{columns}) { -- 2.39.5