PDF导出在php [英] PDF Export in php

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

问题描述



目前我正在使用tcpdf插件。

p>

解决方案

如果您打算从PHP创建PDF,pdflib将帮助您。



否则,如果您想通过PHP将HTML页面转换为PDF,您会发现这里有一点麻烦。



所以,我知道的选择是:



DOMPDF :包装HTML并构建PDF的PHP类。工作良好,可定制(如果你知道PHP),基于pdflib,如果我记得正确,它甚至需要一些CSS。坏消息:当HTML大或非常复杂时,缓慢。



HTML2PS :与DOMPDF相同,但是这首先以.ps(GhostScript),然后以任何您需要的格式(PDF,JPEG,PNG)进行转换。对我来说,这是一个比DOMPDF好一点,但具有相同的速度问题。哦,更好的兼容CSS。



这两个是PHP类,但是如果你可以在服务器上安装一些软件,并通过 passthru () system(),看看这些:



< a href =http://code.google.com/p/wkhtmltopdf/ =nofollow noreferrertitle =wkhtmltopdf> wkhtmltopdf :基于WebKit(Safari的包装),它真的很快速,强大。看起来像是现在HTML(PDF格式转换)中最好的一个,只需2秒钟就可以使用CSS2的3页XHTML文档。这是最近的一个项目,所以google.code页面经常更新。



htmldoc :这是一个坦克,它永远不会停止/崩溃。该项目似乎已经死了,截至2007年,但如果您不需要CSS兼容性,这可能对您而言很好。



tcpdf - 这是一个增强和维护的版本的fpdf。它具有所有的 tpdf的主要功能,它的执行时间更快,输出更好。有关使用两个最受欢迎的PDF生成类的详细教程:TCPDF和FPDF,请按照这个链接。我想你应该继续使用TCPDF 。



另见这些帖子:


  1. 使用PHP将HTML + CSS转换为PDF?

  2. 哪一个是PHP的最佳PDF-API?

  3. 将HTML导出为PDF格式的PHP?

  4. 使用PHP变量将HTML写入PDF文件?

  5. 如何使用php将html转换成pdf?

  6. 用于将HTML导出为pdf的工具

  7. 将PHP文件中的HTML转换为PDF文件


Is there any possibility to write huge data in pdf without changing any ini modifications with less executing time..?

Currently I'm using tcpdf plugin.

解决方案

If your intention is to create a PDF from PHP, pdflib will help you.

Otherwise, if you want to convert an HTML page to PDF via PHP, you'll find a little trouble outta here.

So, the options I know are:

DOMPDF : PHP class that wraps the HTML and builds the PDF. Works good, customizable (if you know PHP), based on pdflib, and, if I remember correctly, it takes even some CSS. Bad news: slow when the HTML is big or very complex.

HTML2PS: same as DOMPDF, but this one converts first in .ps (GhostScript), then, in whatever format you need (PDF, JPEG, PNG). For me it is a little better then DOMPDF, but have the same speed problem. Oh, better compatibility with CSS.

Those two are PHP classes, but if you can install some software on the server, and access it through passthru() or system(), give a look to these too:

wkhtmltopdf: based on WebKit (Safari's wrapper), it's really fast and powerful. Seems like it is the best one (at the moment) for HTML to PDF conversion on the fly, taking only 2 seconds for a 3 page XHTML document with CSS2. It's a recent project anyway, so the google.code page is often updated.

htmldoc : this one is a tank, it really never stops/crashes. The project seems dead, as of 2007, but if you don't need CSS compatibility this can be nice for you.

tcpdf - this is an enhanced and maintained version of fpdf. It has all the main Features of tpdf and it also has faster execution time with great output. For detailed tutorial on using the two most popular PDF generation classes: TCPDF and FPDF, please follow this link. I think you should continue using TCPDF.

See these posts also:

  1. Convert HTML + CSS to PDF with PHP?
  2. Which one is the best PDF-API for PHP?
  3. Export a html into PDF in PHP?
  4. Writing HTML with PHP variables to PDF file?
  5. How to convert html into pdf with php?
  6. Tool for exporting html as pdf
  7. Converting HTML in PHP File to PDF File

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

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