TCPDF/FPDI可以接受PDF作为字符串吗? [英] Can TCPDF / FPDI accept PDF as string?
问题描述
是否可以将TCPDF或FPDI PDF作为字符串提供?我有一个传入的PDF字符串数组,并且无法写入磁盘.我无法在文档中找到与此相关的任何内容.
Is it possible to feed TCPDF or FPDI PDFs as a string? I have an incoming array of PDFs as strings, and I can't write to disk. I wasn't able to find anything in the documentation about this.
如果没有,是否存在一种有效的方法来从内存或作为对象存储/读取这些PDF?喂它们给FPDI?
If not, is there an efficient way to store/read these PDFs from memory or as objects? as to feed them to FPDI?
推荐答案
FPDI不接受字符串,但是 TCPDI 我刚发布的a>除了FDPI的setSourceFile()
外,还有一个setSourceData()
方法,因为我碰巧有完全相同的要求. TCPDI拥有自己的解析器( tcpdi_parser ,基于TCPDF的解析器),它支持1.4版以上的PDF,而无需商业附加组件FPDI-在使用现有PDF时也可能会受益.
FPDI does not accept strings, but TCPDI, which I just released, has a setSourceData()
method in addition to FDPI's setSourceFile()
, as I happened to have the exact same requirement. TCPDI has its own parser (tcpdi_parser, based on TCPDF's parser) which supports PDFs above 1.4 without requiring the commercial addon for FPDI - which may also be of benefit when working with existing PDFs.
这篇关于TCPDF/FPDI可以接受PDF作为字符串吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!