没有使用 pptxGenjs 库在 angular5 中获取数据流

Not getting stream of data in angular5 using pptxGenjs library

我正在尝试在 angular5 中使用 pptxGenjs 在 ppt 文件中添加图像。

我能够获取包含内容的文件,但我想获取 base64 或任何其他输出格式的 ppt 文件数据,但我只获取数据中的文件名。

            const pptx = new pptGen();
            const slide = pptx.addNewSlide();
            // slide.addImage({ data: 'image/png;base64, ' + b64Data + '', x: 1, y: 2, w: 3, h: 3 })
            slide.addImage({ path: '/assets/mean.jpg', x: 1, y: 2, w: 3, h: 3 })
            slide.addText('Image Path!', { x: 1.5, y: 1.5, font_size: 18, color: '363636' });
            pptx.save('jszip', this.getData, 'base64');
            // pptx.save('http', this.getData); // I tried this also

            getData = () => {
               console.log(data);
            }

如何获取ppt文件数据流?如果我在这方面得到任何帮助,那将非常有帮助。

I resolved my problem by making some changes in the library. the changes which I made is:

File: pptxgen.js
go to line no 1823 and replace the code:
// original code
zip.generateAsync({type:'blob'}).then(function(content){ writeFileToBrowser(strExportName, content); });

// code to replace
    zip.generateAsync({type:'blob'})
    .then(function(content){
     gObjPptx.saveCallback(content);
     // writeFileToBrowser(strExportName, content);
    });