npm.io
1.13.0 • Published 1 month ago

modern-openxml

Licence
MIT
Version
1.13.0
Deps
0
Vulns
0
Weekly
0
Stars
11

modern-openxml

Minzip Version Downloads Issues License

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)
  })

Keywords