如何使用 PHP 在 PDF 文件中查找所需文本的坐标?
我一直在寻找使用 PHP 查找 PDF 中字符串坐标的方法,我在 GOOGLE 中搜索,也研究了 SO 中的许多问题,但没有找到相关的内容,有人可以帮我找到解决方案吗...
I have been looking for the way to find the coordinate of string in PDF using PHP I searched in GOOGLE and also looked into many questions in SO, but didnt find something relevant, can someone help me in finding me the solution...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

看看这篇文章,它描述了需要做什么,然后向您展示了一些代码和一个用法示例。它从 pdf 文件中获取文本。然后你可以使用 php strpos function 来搜索其中的字符串。
也许这个问题和答案可以帮助你。它是用 Perl 编写的,但可以完成我认为的工作。也许你可以重写php的代码。
Have a look at this article,, it descripes what is needed to do and then shows you some code and a usage example. It gets the text out of a pdf file. Then you can use php strpos function to search for a string in it.
Maybe this SO question and answer can help you. It is in perl but does the job I think. Maybe you can rewrite the code for php.