我想从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