首页 > 解决方案 > 如何使用我们添加到 Azure 函数中的 HTML 中的图像?

问题描述

在此处输入图像描述

我正在使用 Azure Functions 生成 pdf,我正在生成 pdf 但我无法获取 pdf 上的图像?谁能告诉我如何在我已添加到 index.js 所在文件夹中的 pdf 中添加图像。

if (Code === '1416') {
  account.img = `\EmpPDF\\16.png`;
} else if (Code === '1411') {
  account.img = `\EmpPDF\\11.png`;
} else {
  account.img = `\EmpPDF\\1.png`;
}

const imgPath = Path.join(__dirname, account.img);
context.log("img Path : ", account.img);

标签: azureazure-functions

解决方案


我最好将图像放入 blob 存储中,然后在 azure 函数中请求它们

  [Blob("path/to/image", FileAccess.Read, Connection = "Connection")] Stream image

PS> 在 c# 中,您可以添加属性以从 blob 存储中读取文件。不确定如何在节点中执行,但请看这里


推荐阅读