PptxGenJS icon indicating copy to clipboard operation
PptxGenJS copied to clipboard

Inner shadow property breaks pptx file

Open mmai-me opened this issue 1 year ago • 0 comments

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")

mmai-me avatar Oct 18 '23 10:10 mmai-me