-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