perl:删除PDF格式的页眉和页脚

时间:2015-02-10 14:45:44

标签: perl

我想删除PDF标题,页脚从文档中裁剪页眉和页脚。

我使用下面的脚本,但它已经运行了很长时间(24页PDF)。

use strict; 
use warnings;
use PDF::API2; 

my $filename = shift || 'test.pdf';
my $oldpdf = PDF::API2->open($filename);
my $newpdf = PDF::API2->new;

for my $page_nb (1..$oldpdf->pages) { 
  my ($page, @cropdata);
  $page = $newpdf->importpage($oldpdf, $page_nb);
  $page->cropbox('480%','10%','50%','620%');  
}

这是正确的方法吗?

0 个答案:

没有答案
相关问题