ppt-template
ppt-template copied to clipboard
On NPM
PPT Template
Introduce
PPT Template + Customized Content = Generate Result!
Dictionary
- Presentation - Whole PPT document
- Slide - A page of presentation
Usage
-
Prepare the PPT document as template.
-
Put place-holder text at variable area. Recommend use meaning string surrounding by brackets.
eg. [Title]、[Main Content]
-
Load pptx file by ppt-template API.
-
Get and clone template slide, then replace variable by customized content.
-
Put new sildes in array with wanna order, then generate presentation document.
-
Output your pptx file.
APIs
-
Load PPT Document
// From stream myPresentation.load(...) // From file myPresentation.loadFile(...)
-
Get Silde Count
myPresentation.getSlideCount()
-
Get Slide by Index (Base from index 1)
myPresentation.getSlide(slideIndex)
-
Generate PPT Document
myPresentation.generate(newSlides)
-
Output pptx
// Output file newPresentation.saveAs(...) // Output stream newPresentation.streamAs(...)
-
Clone Slide
mySlide.clone()
-
Fill Content
pair = {key:'place-holder', value:'content'} mySlide.fill(pair) pairs = [pair, pair] mySlide.fillAll(pairs)
Example
Example Code
Command
-
Initial
npm install
-
Babel Build
npm run build
-
Mocha Test
npm run test
-
Example
npm run example