-1
我需要获得perl中pdf文件页面上的现有边距(左,右,上,下),以下是获取padf页面的维度的代码。获取PDF页面上的现有保证金
!在/ usr/bin中/ perl的
use strict;
use warnings;
use CAM::PDF;
my $pdf = CAM::PDF->new('test2.pdf');
my $num_page=$pdf->numPages();
print "Total Pages : $num_page\n";
my ($x,$y,$width,$height)=$pdf->getPageDimensions(2);
print "Dimension of PDF File : $width x $height px \n";
$width=sprintf("%.2f",$width/72); # PPI/DPI Conversion (72 px = 1 inch)
$height=sprintf("%.2f",$height/72);
print "Dimension of PDF File is : $width x $height inch \n"
请提出您的问题标题**短**问题描述(4-5个字),并在正文中详细解释您的问题**(使用[编辑]链接请)。 – Mat