How to add header, footer with images using PDF::API2::Lite ?
- by Space
Is it possible to add header(with image) and footer (with page number) with images. I wrote below code to create a PDF document which shows png images.
If this can be done easily with any other module, please suggest.Really appreciate response with sample code.
use strict;
use PDF::API2::Lite;
use Getopt::Long;
my $outfile;
my $path;
my $options = GetOptions( "outfile=s" => \$outfile,
"images=s" => \$path,);
my @images = sort glob("$path") or die "No Files\n";
my $pdf = PDF::API2::Lite->new();
for my $png ( sort @images ) {
my $image = $pdf->image_png( "$png" );
$pdf->page(1150,450);
$pdf->image($image, 10, 10);
}
$pdf->saveas( $outfile );