【发布时间】:2011-02-26 05:40:25
【问题描述】:
是否可以在图像中添加页眉(带有文本和一张图像)和页脚(带有页码)。我编写了下面的代码来创建一个显示 png 图像的 PDF 文档。
如果这可以通过任何其他模块轻松完成,请提出建议。非常感谢您提供示例代码的响应。
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 );
【问题讨论】:
标签: perl pdf perl-module