如何使用 Zend_Pdf 从 pdf 页面中提取文本
谁能帮忙从 pdf 页面中提取文本?
<?php
$pdf = Zend_Pdf::load('example.pdf');
$page = $pdf->page[0];
我假设存在一个页面方法,但我找不到任何可以让我提取内容的东西。
示例:$page->getContents(); $page->toString(); $page->extractText();
...帮助!!!!这让我发疯!
Can anyone help with extracting text from a page in a pdf?
<?php
$pdf = Zend_Pdf::load('example.pdf');
$page = $pdf->page[0];
I would assume a page method would exist but I could not find anything to let me extract the contents.
Example: $page->getContents(); $page->toString(); $page->extractText();
...Help!!!! This is driving me crazy!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我同意安迪的观点,这似乎不受支持。作为替代方案,请查看 Shaun Farrell 的解决方案从 PDF 中提取文本以与 Zend_Search_Lucene 一起使用。他使用 XPDF,这也可能满足您的需求。
I agree with Andy that this does not appear to be supported. As an alternative, take a look at Shaun Farrell's solution to extracting text from a PDF for use with Zend_Search_Lucene. He uses XPDF, which might also meet your needs.
从手册来看,似乎不支持此功能。此外,新文本是使用 drawText() 函数 编写的,它似乎写的是图像,而不是普通的“可解码”文本。
From the manual it doesn't appear that this functionality is supported. Also, new text is written using the drawText() function, which appears to write images, not plain "decodable" text.