使用 PHP 搜索 PDF 文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1882318/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Search through PDF files with PHP
提问by Ben Fransen
I'm trying to find a way to search inside PDF files. I came accross the PHP PDF class but I can't seem to find any function for reading/searching a filestream.
我正在尝试找到一种在 PDF 文件中进行搜索的方法。我遇到了 PHP PDF 类,但似乎找不到任何用于读取/搜索文件流的函数。
So, as naive as I am, i tried to simple get a stream using file_get_contents(), obviously it's an encrypted-like output ;)
因此,尽管我很天真,但我尝试使用 file_get_contents() 来简单地获取流,显然它是一个类似加密的输出;)
So my question, is there any way to search through PDF files? I'm looking for script-only / free / open source solutions and not buying some expensive commercial libraray.
所以我的问题是,有没有办法搜索PDF文件?我正在寻找纯脚本/免费/开源解决方案,而不是购买一些昂贵的商业图书馆。
采纳答案by Daniel May
XPDF?
XPDF?
There is a blog post herethat may be of help.
有一个博客张贴在这里可能会有所帮助。
There seems to be some code herethat could help - a simple class that reads a PDF into plaintext. Unsure if it supports decryption.
似乎有一些代码在这里,可以帮助-一个简单的类读取PDF成明文。不确定它是否支持解密。
There are also a number of resources in PHP documentation that may help you. Click.
PHP 文档中还有许多资源可以帮助您。点击。
FPDFand FPDImay also help. Probably your best bet after some research.**

