in reply to Perl to PDF
Here are some examples using PDF::API2:#!/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...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl to PDF
by CColin (Scribe) on Nov 20, 2009 at 00:40 UTC |