我想從pdf中提取一些信息。我正嘗試使用CAM::PDF
模塊中的getpdftext.pl
。當我運行$~ getpdftext.pl sample.pdf
時,它會生成一個pdf文本到stdout。在perl中解析pdf
但我想寫這個文本文件並解析perl中的必需字段。有人可以請指導我如何做到這一點?
但是,當我嘗試在我的Perl腳本中調用pdftotext.pl
我得到一個No such file
錯誤。
#program從PDF提取文本,並將其保存在文本文件中
use PDF;
use CAM::PDF;
use CAM::PDF::PageText;
use warnings;
use IPC::System::Simple qw(system capture);
$filein = 'sample.pdf';
$fileout = 'output1.txt';
open OUT, ">$fileout" or die "error: $!";
open IN, "getpdftext.pl $filein" or die "error :$!" ;
while(<IN>)
{
print OUT $fileout;
}
thanks mob, - |選項幫助 – sandyutd