【发布时间】:2020-10-26 06:52:54
【问题描述】:
我正在使用 Pdfparser Library 来解析 pdf。解析时,会读取 20 页 pdf 文件的某些页面,而某些页面则不会。这是我正在使用的代码
$str_path = 'example_book.pdf';
$parser = new \Smalot\PdfParser\Parser();
$pdf = $parser->parseFile($str_path);
$pages = $pdf->getPages();
$page = $pages[7];
$text = $page->getText();
echo $text;
当我运行 php 脚本时出现此错误:
Call to undefined method Smalot\PdfParser\Encoding::__toString()
Smalot\PdfParser\Font::translateChar
vendor/smalot/pdfparser/src/Smalot/PdfParser/Font.php:104
还有其他方法吗?
【问题讨论】:
标签: php pdf-parsing