将 CodeIgniter 视图转换为 PDF
我正在尝试使用 TCPDF 库将视图文件的输出转换为 PDF。但我不知道如何配置它。我读过的每个教程都指出 PDF 数据应包含在视图之外。 所以问题是,我确实无法将视图输出转换为 PDF?
I'm trying to convert an output from a view file into PDF with TCPDF library. But I don't know how to configure it. Every tutorial I've read states that the PDF data should be included outside of view.
So the question is, it's a truth that I can't convert output from view into PDF?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这可能与您通常使用 TCPDF 创建 PDF 文件的方式有关。
您不能只获取一个视图(或视图的输出)并告诉 TCPDF“将我的 HTML 创建为 PDF”。 TCPDF 需要您告诉它在哪些单元格中放置什么内容。
如果您需要根据自己的视图创建 PDF,您可以查看此项目而不是 TCPDF 。我自己没有尝试过,但我听说过一些关于它的好消息。
This has probably something to do with the way you would normally create PDF files with TCPDF.
You can't just take a view (or the output from one) and tell TCPDF to 'create my HTML as a PDF'. TCPDF needs you to tell it where to put what in which cells.
You could take a look at this project instead of TCPDF if you need to create PDF's from your views. I haven't tried it myself, but I've heard some good things about it.