$page->cropbox($llx, $lly, $urx, $ury);
}
-$cropped->saveas(basename($meta->{input}, '.pdf') . '-cropped.pdf');
+$cropped->saveas(basename($metafile, ('.pdf.stitch', '.stitch')) . '-cropped.pdf');
use strict;
+use File::Basename;
use PDF::API2;
use YAML;
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;
my ($llx, $lly, $urx, $ury) = $page->get_mediabox;
my $meta = {
- input => $infile,
+ input => basename($infile),
x => (($urx - $llx)*0.1)/2,
y => (($ury - $lly)*0.1)/2,
width => ($urx - $llx)*0.9,
$content->fill();
}
-$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');