I'm trying the following code and it gives an error that PptxGenJS is not defined.
// Import any other script files here, e.g.:
// import * as myModule from "./mymodule.js";
import * as pptxgen from "https://cdn.jsdelivr.net/npm/pptxgenjs@3.6.0/dist/pptxgen.bundle.js";
runOnStartup(async runtime =>
{
// Code to run on the loading screen.
// Note layouts, objects etc. are not yet available.
runtime.addEventListener("beforeprojectstart", () => OnBeforeProjectStart(runtime));
});
async function OnBeforeProjectStart(runtime)
{
// Code to run just before 'On start of layout' on
// the first layout. Loading has finished and initial
// instances are created and available to use here.
//runtime.assets.loadScripts("https://cdn.jsdelivr.net/gh/gitbrent/pptxgenjs@3.6.0/dist/pptxgen.bundle.js");
runtime.addEventListener("tick", () => Tick(runtime));
}
function Tick(runtime)
{
// Code to run every tick
}
export function pptxdemo()
{
let pptx = new PptxGenJS();
let slide = pptx.addSlide();
slide.addText("This is an amazing demo", {
x: 0,
y: 1,
w: "100%",
h: 2,
align: "center",
color: "0088CC",
fill: "F1F1F1",
fontSize: 24,
});
pptx.writeFile({ fileName: "PptxGenJS-Demo" });
}