我需要从一个复杂的PDF中读取特定部分。我在网上搜索了一些信息,有些人说FPDF不错,但它不能读取PDF,只能写入。是否有可以提取给定PDF的某些内容的库?
如果没有这样的库,那么有什么好方法可以读取给定PDF的特定部分吗?
谢谢!
https://whatisprymas.wordpress.com/2010/04/28/lucene-how-to-index-pdf-files/
$result = pdf2text ('sample.pdf');
echo "<pre>$result</pre>";
use Smalot\PdfParser\Parser;
$pdfParser = new Parser();
$pdf = $pdfParser->parseFile('../path/to/your.pdf');
$content = $pdf->getText()
// or if you need to maintain the paragraphs
$content = preg_replace('/\s{3,}/m', "\n\n", trim($pdf->getText()));
那个怎么样?
http://www.phpclasses.org/package/702-PHP-Searches-pdf-documents-for-text.html
备注:我没有测试过这个类,只是阅读了描述。