使用 phantomJS 生成 PDF - 是否可以使 phantomJS 从流而不是 URL 地址读取?

PDF generation with phantomJS - is it possible to make phantomJS read from a stream instead of an URL address?

当谈到生成更大的文件时,很难使用通常的方法 - 将 html 保存到文件,然后将其传递给 phantomJS 再次读取它,然后进行转换。我已经在我的 I3 4Gb RAM 机器上试过了,一个 ~600Mb 的文件转换耗尽了所有可用的交换和内存,然后 phantomJS 崩溃了。 所以,我想我需要一种方法将数据直接流式传输到 phantomJS,如下所示:

    Datasource -> phantomJS -> http socket

但我找不到流式传输到 phantomJS 的方法。有任何想法吗? 顺便说一句,我正在使用 nodeJS。 提前致谢。

不,PhantomJS 不支持这种方式的流页面。