#!/usr/local/bin/perl use strict; use warnings; use File::Find; use PDF::API2::Lite; my $dir = "."; #my $pdf = PDF::API2::Lite->new; in case you want one pdf file find(\&find_convert, "$dir"); sub find_convert{ if(/.*\.jpg/){ my $image = $File::Find::name; print "$image\n"; convert(); } } sub convert{ #the are repeated for every match my $image=$_; my $pdf = PDF::API2::Lite->new; my $imageObject=$pdf->image_jpeg("$image"); $pdf->page($imageObject->width, $imageObject->height); $pdf->image($imageObject,0,0); $pdf->saveas("$image.pdf"); }; #$pdf->saveas("$image.pdf"); images are included in the same file...