modern-openxml
v0.0.2
Published
OpenXML for JavaScript
Downloads
121
Maintainers
Readme
PPTX to JSON
import { PPTX } from 'modern-openxml'
import presetShapeDefinitions from 'modern-openxml/presetShapeDefinitions'
fetch('example.pptx')
.then(rep => rep.arrayBuffer())
.then((buffer) => {
const pptx = new PPTX(buffer, { presetShapeDefinitions })
console.log(pptx.toJSON())
})
PPTX to SVG
import { PPTX, PPTXToSVGRenderer } from 'modern-openxml'
import presetShapeDefinitions from 'modern-openxml/presetShapeDefinitions'
fetch('example.pptx')
.then(rep => rep.arrayBuffer())
.then((buffer) => {
const pptx = new PPTX(buffer, { presetShapeDefinitions })
const svgRenderer = new PPTXToSVGRenderer(pptx)
document.body.appendChild(svgRenderer.toSVG())
console.log(svgRenderer.toSVGString())
})