开始使用库 PptxGenJs。想要创建一个在幻灯片中插入图像/徽标的母版幻灯片。然而,当我打开 powerpoint 时,我得到一个大红色 X 而不是我想要的图形。目前使用 Powerpoint 2013 打开我的 powerpoint
我也尝试过使用该功能添加图像
slide.addImage({OPTIONS});
它仍然显示为红色。我尝试了不同类型的图像(jpeg 和 png),但仍然出现相同的错误。
window.doDemo = function demo() {
var pptx = new PptxGenJS();
pptx.setLayout('LAYOUT_4x3')
pptx.defineSlideMaster({
title: 'MASTER_SLIDE',
bkgd: 'FFFFFF',
objects: [
{ 'line': { x: 3.5, y:1.00, w:6.00, line:'0088CC', lineSize:5 } },
{ 'rect': { x: 0.0, y:5.30, w:'100%', h:0.75, fill:'F1F1F1' } },
{ 'text': { text:'Status Report', options:{ x:3.0, y:5.30, w:5.5, h:0.75 } } },
],
slideNumber: { x:0.3, y:'90%' }
});
var slide = pptx.addNewSlide('MASTER_SLIDE');
slide.addImage({ path:'hey.png', x:1, y:1, w:8.0, h:4.0 });
slide.addText('How To Create PowerPoint Presentations with JavaScript', { x:0.5, y:0.7, fontSize:18 });
pptx.save();
}