PHPExcel创建/样式/保存PDF文档 [英] PHPExcel create/style/save PDF Documentation

查看:121
本文介绍了PHPExcel创建/样式/保存PDF文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在几个项目中使用PHPExcel库,并且喜欢它提供的功能.目前,我需要另存为PDF,并发现PHPExcel可以做到这一点,但我发现很难跟踪该过程中的一些示例或文档.

I'm using the PHPExcel library in a couple of project and love the functionality it provides. Currently I needed to save as a PDF and found that PHPExcel can do this but I'm finding it rather hard to track down some examples or documentation on the process.

以下是我找到的链接:

  • http://phpexcel.codeplex.com/wikipage?title=News%20archive
  • http://www.devshed.com/c/a/PHP/PHP-Excel-Working-with-Workbook-and-PDF-Files/1/

后续问题:

我需要PDF来使其外观和功能,预填充数据字段以及选择其他选项的功能. PHPExcel是否将是正确的选择?目前,我在命令行上使用 pdftk ,并且更改服务器已导致需要降级的问题版本较旧的版本.很好,但是我想我正在寻找取代它的地方,并采用基于PHP的方法.

I need the PDF to look and function as a form, the ability to prefill data fields, and select different options. Would PHPExcel be the right choice for this? Currently I'm using pdftk on the command line and changing servers has caused the problem of needing to downgrade the version to an older one. This is fine but I think I'm looking to replace this and go with a PHP based approach.

有什么想法吗?有建议吗?

Thoughts? Suggestions?

推荐答案

PHPExcel使用 tcpdf库进行渲染PDF.如果您查看相应的源代码,您会发现它没有不允许从外部访问它创建的PDF对象. tcpdf确实支持表单元素,因此看来您的解决方案是为PHPExcel编写自己的Writer类,或者只是修改该代码,以便获得所需的结果.

PHPExcel uses the tcpdf library to render the PDF. If you look at the appropriate source code, you'll see it doesn't allow external access to the PDF object it creates. tcpdf does support form elements, so it appears your solution is to write your own Writer class for PHPExcel or just modify that code so you can get the results you're looking for.

这篇关于PHPExcel创建/样式/保存PDF文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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