]> git.sur5r.net Git - pdfstitch/commitdiff
Allow "blank" in pageorder to insert blank page
authorJakob Haufe <sur5r@sur5r.net>
Mon, 3 Jul 2017 19:22:12 +0000 (21:22 +0200)
committerJakob Haufe <sur5r@sur5r.net>
Mon, 3 Jul 2017 19:22:12 +0000 (21:22 +0200)
pdfstitch

index 0608bc87f8b5f2f9bc2efc517466a8a333434ad6..c7aa1a5238ce6557c5493b11b5ca6a9b1b596be0 100755 (executable)
--- 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})
     {