I am trying to use PerlMagick to convert PDFs into multiple TIFF images. For the most part everything is working, except for the file numbering. Normally I'd just call
'convert -density 240x240 -compress Group4 -scene 15 test.pdf testp%04d.tif'
to get files tiffp0015.tif though testp0018.tif (for a 4-page PDF). I tried to translate this into PerlMagick with the following code:
#!/usr/bin/perl
use strict;
use warnings;
use Image::Magick;
my $image = Image::Magick->new;
my $filename = "test.pdf";
$image->Read($filename);
$image->Set(scene=>15);
$image->Write(filename=>"testp%04d.tif",
compression=>'Group4',
density=>"240x240");
but it is still outputting testp0000.tif - testp0003.tiff
How do I get it to start with the correct scene number?