modern-openxml
Install
npm i modern-openxml
Methods
preset shape definitions
preset text warp definitions
PPTX to IDoc
import { pptxToDoc } from 'modern-openxml'
import presetShapeDefinitions from 'modern-openxml/presetShapeDefinitions'
fetch('./example.pptx')
.then(rep => rep.arrayBuffer())
.then(async (buffer) => {
const pptx = await pptxToDoc(new Uint8Array(buffer), { presetShapeDefinitions })
console.log(pptx)
})
PPTX to SVG
Needs modern-idoc-svg
npm i modern-idoc-svg
import { docToSvg } from 'modern-idoc-svg'
import { pptxToDoc } from 'modern-openxml'
import presetShapeDefinitions from 'modern-openxml/presetShapeDefinitions'
fetch('./example.pptx')
.then(rep => rep.arrayBuffer())
.then(async (buffer) => {
const pptx = await pptxToDoc(new Uint8Array(buffer), { presetShapeDefinitions })
const pptxSvg = docToSvg(pptx)
console.log(pptxSvg)
document.body.appendChild(pptxSvg)
})