开发者

How to extract text using Zend_Pdf from pdf page

开发者 https://www.devze.com 2022-12-23 14:23 出处:网络
Can anyone help with extracting text from a page in a pdf? <?php $pdf = Zend_Pdf::load(\'example.pdf\');

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!!!!开发者_如何学Go This is driving me crazy!


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消