【发布时间】:2014-05-08 15:14:28
【问题描述】:
我在 node.js express 3 项目中使用 pdfkit 0.6.1。
我想将 PDF 作为 HTTP 响应发送,而不是将其保存在服务器上。
http://pdfkit.org/docs/getting_started.html 的示例说要使用:
# HTTP response
doc.pipe fs.createWriteStream(res)
# add stuff to PDF here
# finalize the PDF and end the stream
doc.end()
但是我收到一条错误消息:“500 TypeError: path must be a string”
【问题讨论】: