Is it possible to add header(with text and one 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
";
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 );
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…