import pptxgen from "npm:pptxgenjs";
export let powerPointExample = async (req: Request) => {
if (!req.url.includes("download")) return Response.json("ok");
let pres = new pptxgen();
let slide = pres.addSlide();
let textboxText = "Hello World from PptxGenJS!";
let textboxOpts = { x: 1, y: 1, color: "363636" };
slide.addText(textboxText, textboxOpts);
const output = await pres.stream();
return new Response(output, {
headers: {
"Content-Type": "application/vnd.ms-powerpoint",
},
});
};