我在我的 React 应用程序中使用 pptxgenjs 在浏览器上生成 PPT。我在使用 Web 路径向幻灯片添加图像时遇到问题。
const ppt = new pptxgen();
const coverSlide = ppt.addSlide();
coverSlide.addImage({
path: 'https://storage.googleapis.com/dandi-dev-assets/logo-smiley.png',
x: MARGIN_LEFT / PPI,
y: MARGIN_TOP / PPI,
w: 20 / PPI,
h: 20 / PPI
});
它给我一个错误,它无法加载图像。我正在使用浏览器中的 pptxgenjs。
为什么会发生这种情况?我的代码有什么问题吗?