创建 PDF 并将其上传到 Azure Blob 存储
我正在使用 PDFkit 创建 PDF,但是我想将创建的 PDF 上传到 azure blob 存储。我有以下代码(打字稿),但它不起作用:
const doc = new PDFDocument();
doc.fontSize(27).text("test", 100, 100);
doc.end();
const uploadBlobResponse = await blockBlobClient.upload(
doc,
Buffer.byteLength(doc)
);
我能够连接到azure blob存储,但是上传部分不起作用
I'm using PDFkit to create a PDF, however I want to upload the created PDF to azure blob storage. I have the below code (typescript) but its not working:
const doc = new PDFDocument();
doc.fontSize(27).text("test", 100, 100);
doc.end();
const uploadBlobResponse = await blockBlobClient.upload(
doc,
Buffer.byteLength(doc)
);
i'm able to connect to the azure blob storage, however the uploading part is not working
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经在我的环境中进行了测试
您可以使用以下代码将PDF文件从PDFKIT上传到Azure Blob存储
I have tested in my environment
You can use the below code to upload PDF file from PDFKIT to Azure Blob Storage