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

Error: blob is not supported by this platform #1307

Open DeveloperMCD opened 8 months ago

DeveloperMCD commented 8 months ago

I'm using the straight sample code from the website. Can't get it working in React Native.

import pptxgen from "pptxgenjs"; let pptx = new pptxgen();

let slide = pptx.addSlide(); slide.addText("React Demo!", { x: 1, y: 1, w: 10, fontSize: 36, fill: { color: "F1F1F1" }, align: "center" });

pptx.writeFile({ fileName: "react-demo.pptx" }) .then((fileName) => { logWithTime('PPTX file written to phone: ${fileName}', 'pptx'); }) .catch((err) => { logWithTime(err, 'pptx'); });

Versions I'm using: "react": "18.2.0", "react-native": "0.72.4", "jetifier": "^2.0.0", "pptxgenjs": "^3.12.0",

Node: v21.2.0

Getting error back from writeFile promise:

[Error: blob is not supported by this platform]