Return to Snippet

Revision: 8350
at September 16, 2008 10:40 by rubinsta


Initial Code
#!/usr/bin/env perl                                                           

use warnings;
use strict;
use Getopt::Std;
use PDF::FromImage;

our %opts;

getopt('d:f:o:',  \%opts);

if (!%opts) {

print STDERR << "EOF";

 Usage: [-d directory][-f image file] -o output.pdf

EOF
   exit;
}

elsif ($opts{d}) {

  my $pdf = PDF::FromImage->new;

  my @files = <$opts{d}/*.tif>;

  my @rfiles = reverse(@files);

  $pdf->load_images(@rfiles);

  $pdf->write_file("$opts{o}");
}

if ($opts{f}) {
  my $pdf = PDF::FromImage->new;

   $pdf->load_images("$opts{f}");

   $pdf->write_file("$opts{o}");
}

Initial URL


Initial Description
Used for converting, compiling, and reversing tiff files from the Book Center's digital library.

Initial Title
Tiff2PDF converter for NYBC Files

Initial Tags
perl

Initial Language
Perl