gitbrent / PptxGenJS

Create PowerPoint presentations with a powerful, concise JavaScript API.
https://gitbrent.github.io/PptxGenJS/
MIT License
2.62k stars 611 forks source link

Inner shadow property breaks pptx file #1293

Open mmai-me opened 9 months ago

mmai-me commented 9 months ago

I believe I have found an unusual bug.

The shadow property breaks the pptx file if the type is set to 'inner', whereas it would generate the file soundly if it were set to 'outer'.

This is not to say that the inner shadow is not working for all components, as this has been noticed with rounded rectangle and rectangle shapes.

you can test it yourself with this example:

let pptx = new PptxGenJS();
let slide = pptx.addSlide();

var sh_type = 'outer' // try changing it to inner
var shadowOpts = { type: sh_type , color:'000000', blur:1, offset:0, angle:0, opacity:0.3 };

slide.addShape(pptx.ShapeType.roundRect, {
  x: 0.0,  y: 0.25,  w: '100%',  h: 1.5,
  align: 'center',  fontSize: 24,
  color: '0088CC',  fill: 'F1F1F1',
  rectRadius: 45,
  shadow: shadowOpts
});

// Save the PowerPoint file
pptx.writeFile("example.pptx")