At 11:42 -0600 4/11/02, Bill Stephenson wrote:
It is quite amazing. I had a really old newsletter that I want'ed to make available, so I scanned in each page in to a folder of .gif images, and then wrote a perl script (below) using ImageMagick to pack them together in to a PDF - worked like a charm.Thanks Randal! I've wanted to play with PerlMagick for years. I've played with ImageMagick but never got PerlMagick installed. I'm gonna have to try it our now.
Very cool!
Peter.
use Image::Magick;
use warnings;
use strict;
my $dir = '/Users/peter/3.2.out';
my $pdffile = '/Users/peter/3.2.pdf';
chdir( $dir ) or die "Cant chdir to $dir $!";
while( <*.gif> ) {
push @files, $_;
}
my $pdf = Image::Magick->new();
foreach $file ( sort @files ) {
my $img = Image::Magick->new();
$rc = $img->Read( $file );
warn $rc if $rc;
push @$pdf, $img;
}
$pdf->[0]->Coalesce();
$pdf->Write( $pdffile );
--
<http://www.interarchy.com/> <http://download.interarchy.com/>
