- Write output to current working directory
- Generate output PDF names based on meta file instead of origin PDF to
allow for multiple stitch jobs per PDF
$page->cropbox($llx, $lly, $urx, $ury);
}
$page->cropbox($llx, $lly, $urx, $ury);
}
-$cropped->saveas(basename($meta->{input}, '.pdf') . '-cropped.pdf');
+$cropped->saveas(basename($metafile, ('.pdf.stitch', '.stitch')) . '-cropped.pdf');
die "Please specify PDF to examine!\n" unless defined $infile;
die "Could not open $infile!\n" unless -r $infile;
die "Please specify PDF to examine!\n" unless defined $infile;
die "Could not open $infile!\n" unless -r $infile;
-my $outfile = "${infile}.stitch";
+my $outfile = basename($infile) . ".stitch";
die "$outfile exists, aborting!\n" if -e $outfile;
die "$outfile exists, aborting!\n" if -e $outfile;
my ($llx, $lly, $urx, $ury) = $page->get_mediabox;
my $meta = {
my ($llx, $lly, $urx, $ury) = $page->get_mediabox;
my $meta = {
+ input => basename($infile),
x => (($urx - $llx)*0.1)/2,
y => (($ury - $lly)*0.1)/2,
width => ($urx - $llx)*0.9,
x => (($urx - $llx)*0.1)/2,
y => (($ury - $lly)*0.1)/2,
width => ($urx - $llx)*0.9,
-$outpdf->saveas(basename($meta->{input}, '.pdf') . '-preview.pdf');
+$outpdf->saveas(basename($metafile, ('.pdf.stitch','.stitch')) . '-preview.pdf');
-$outpdf->saveas(basename($meta->{input}, '.pdf') . '-stitched.pdf');
+$outpdf->saveas(basename($metafile, ('.pdf.stitch','.stitch')) . '-stitched.pdf');