#!usr/bin/perl -w use strict; use PDF::API2::Lite; #concatenates all files in a specific directory into a pdf file that will #be spit out into that same directory upon completion #grab a list of files in our very special directory. my @files = sort glob('path\to\jpgs\*') or die "No files"; #xreate a new document with no pages my $pdf = PDF::API2::Lite->new; #loop through our images, create a page for each image # - while adding the image to the created page for my $file (@files){ my $image = $pdf->image_jpeg($file); $pdf->page($image->width, $image->height); $pdf->image($image, 0, 0); } $pdf->saveas('output.pdf');