How to add header, footer with images using PDF::API2::Lite ?

Posted by Space on Stack Overflow See other posts from Stack Overflow or by Space
Published on 2010-06-01T07:25:21Z Indexed on 2010/06/01 8:43 UTC
Read the original article Hit count: 150

Filed under:
|
|

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 );

© Stack Overflow or respective owner

Related posts about perl

Related posts about pdf