用php阅读pdf文件 [英] Read pdf files with php

查看:124
本文介绍了用php阅读pdf文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个很大的PDF文件,它是建筑物的平面图.它具有用于所有办公家具的层,包括座位位置的文本框.

I have a large PDF file that is a floor map for a building. It has layers for all the office furniture including text boxes of seat location.

我的目标是使用PHP读取此文件,在文档中搜索文本层,获取其内容和文件中的坐标.这样,我可以绘制出座位位置-> x/y坐标.

My goal is to read this file with PHP, search the document for text layers, get their contents and coordinates in the file. This way I can map out seat locations -> x/y coordinates.

有什么办法可以通过PHP做到这一点? (或者,如果需要的话甚至可以使用Ruby或Python)

Is there any way to do this via PHP? (Or even Ruby or Python if that's what's necessary)

推荐答案

签出FPDF(使用FPDI):

Check out FPDF (with FPDI):

http://www.fpdf.org/

http://www.setasign.de/products/pdf-php -solutions/fpdi/

这些可以让您打开pdf并使用PHP向其中添加内容.我猜您也可以使用它们的功能在现有内容中搜索所需的值.

These will let you open an pdf and add content to it in PHP. I'm guessing you can also use their functionality to search through the existing content for the values you need.

另一个可能的库是TCPDF: http://www.tecnick. com/public/code/cp_dpage.php?aiocp_dp = tcpdf

Another possible library is TCPDF: http://www.tecnick.com/public/code/cp_dpage.php?aiocp_dp=tcpdf

更新以添加更现代的库: PDF解析器

Update to add a more modern library: PDF Parser

这篇关于用php阅读pdf文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆