使用PHP对PDF文件进行微调
What I'd like to do
I'd like to allow a user to download a dynamically generated pdf file (certificate). I was thinking of creating a pdf template and just write the user's name on it with PHP, that's the only thing that will be dynamic about this.
How I'd like to do it
Since the application is for a client and I have no idea on what server will he use it I'd like to know if there are ways of achieving this without any extra extensions or whatsoever to be installed on the server. I can assume he has PHP > 5. Basically read the template pdf and write a string to it then save it to be able to offer for download, all this with PHP?
我想做什么 strong> p>
我想允许用户下载动态生成的pdf文件(证书)。 我正在考虑创建一个pdf模板,并用PHP在其上写下用户的名字,这是唯一一个动态的东西。 p>
我想怎么样 做它 strong> p>
由于应用程序是针对客户端的,我不知道他将使用什么服务器,我想知道是否有办法实现这一点 任何额外的扩展或任何要安装在服务器上。 我可以假设他有PHP> 5.
基本上读取模板pdf并写一个字符串然后保存它以便能够提供下载,这一切都用PHP? p>
div>
doing this with pure php on your own will get very messy, so i recommend using FPDF in combination with FPDI (to open your templates). both can easily be added to your projects sources, so you don't need to install any extensions (unless you want to compress your PDFs - in that case you'll need zlib installed).