我正在尝试使用Perl从PDF文件中提取文本/图像/表格。我尝试使用
CAM::PDF
,但它提取的不是文本而是其他格式。是否有一种方法可以使用Perl模块从PDF中提取文本/图像/表格?CAM::PDF
,但它提取的不是文本而是其他格式。是否有一种方法可以使用Perl模块从PDF中提取文本/图像/表格?@priya..我尝试了这个模块,它对于PDF文本提取非常有效。
use strict;
use warnings;
use PDF::OCR::Thorough;
my $filename = "pdf.pdf";
my $pdf = PDF::OCR::Thorough->new($filename);
my $text = $pdf->get_text();
print "$text";
使用CAM::PDF。它有一些方法可以帮助您提取图像或其他元素:
$doc->getProperty($pagenum, $propertyname)
Each PDF page contains a list of resources that it uses (images, fonts, etc). getPropertyNames() returns an array of the names of those resources. getProperty() returns a node representing a named property (most likely a reference node).
pdftohtml
。不需要让自己失去理智。 - Sinan Ünür