# ppt-template

> Generate .pptx by replacing content in template.

Latest version **1.0.9** (published 2017-05-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install ppt-template
pnpm add ppt-template
yarn add ppt-template
bun add ppt-template
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.9 |
| Published | 2017-05-29 |
| First published | 2016-11-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 23 |
| Author | Eating Li |
| Maintainers | eating-lee |
| Keywords | powerpoint, ppt, .pptx, generate |

## Links

- npm: https://www.npmjs.com/package/ppt-template
- Repository: https://github.com/eatingli/ppt-template
- Homepage: https://github.com/eatingli/ppt-template#readme
- Issues: https://github.com/eatingli/ppt-template/issues
- npm.io page: https://npm.io/package/ppt-template

## Dependencies (4)

- [jszip](https://npm.io/package/jszip.md) ^3.1.3
- [xml2js](https://npm.io/package/xml2js.md) ^0.4.17
- [entities](https://npm.io/package/entities.md) ^1.1.1
- [fs-promise](https://npm.io/package/fs-promise.md) ^1.0.0

## Recent versions

- 1.0.9 (latest) — 2017-05-29
- 1.0.8 — 2017-05-29
- 1.0.7 — 2017-05-29
- 1.0.6 — 2017-02-03
- 1.0.5 — 2017-02-02
- 1.0.4 — 2017-02-02
- 1.0.3 — 2016-12-21
- 1.0.2 — 2016-12-01
- 1.0.1 — 2016-12-01
- 1.0.0 — 2016-11-30
- 0.0.3 — 2016-11-23
- 0.0.2 — 2016-11-23
- 0.0.1 — 2016-11-22

## README

# PPT Template

## Introduce

### PPT Template + Customized Content = Generate Result！

![template](/img/01.png)
![customized content](/img/02.png)
![generate result](/img/03.png)

## Dictionary

- **Presentation** - Whole PPT document
- **Slide** - A page of presentation

## Use

1. Prepare the PPT document as template.
2. Put **place-holder** text at variable area. Recommend use meaning string surrounding by brackets.

    eg. **[Title]**、**[Main Content]**

3. Load pptx file by ppt-template API.
4. Get and clone template slide, then replace variable by customized content.
5. Put new sildes in array with wanna order, then generate presentation document.
6. 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](/example/example.js)


## Command

- **Initial**

        npm install

- **Babel Build**

        npm run build

- **Mocha Test**

        npm run test

- **Example**

        npm run example

---
_Source: https://npm.io/package/ppt-template · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
