I want to create a pptx file with javascript and send it to the server. To do so, I am going to create a pptx file as blob.
Generating from the regular Client Browser, not Node.js. Below is the pptxGenjs site. https://gitbrent.githubio/PptxGenJS/docs/usage-save.html
The problem is not created as blob when pptx containing the image. When I print out a log on the console, only the name of pptx is shown. (It shall be printed on the console in the form of a blob.)
...
var ppt_name = 'AAAA.pptx';
var pptx = new PptxGenJS();
pptx.setLayout('LAYOUT_4x3');
pptx.defineSlideMaster({
title: 'MASTER_SLIDE',
bkgd: 'FFFFFF',
objects: [
{ 'text': { text:'Writer', options:{ x:6.5, y:0.2, fontSize:8 } } },
{ 'text': { text:'Date', options:{ x:8.0, y:0.2, fontSize:8 } } }
],
slideNumber: {x: 0.3, y: '90%'}});
var slide = pptx.addNewSlide('MASTER_SLIDE');
slide.addImage({x: 0.5, y: 2.40, w: 2.67, h: 2.0, path:"/assets/main/AAA/AAA.png"});
pptx.save(ppt_name, function(blob){console.log(blob);},'blob');
...
But when I changed last part of the same code, (Download .pptx by download prompt) image is well included in pptx. pptx.save(ppt_name);
and here is my console output.
When slide.addimage is not used
What is the cause? Thanks!