misterMatt has asked for the wisdom of the Perl Monks concerning the following question:
#!usr/bin/perl -w use strict; use PDF::API2::Lite; #concatenates all files in a specific directory into a pdf file that w +ill #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');
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: PDF::API2::Lite adding images
by Anonymous Monk on Aug 19, 2009 at 00:12 UTC |