<commit_before># PptxGenJS
Client-side JavaScript framework that produces PowerPoint (pptx) presentations.

By including the PptxGenJS framework inside an HTML page, you have the ability to quickly and
easily produce PowerPoint presentations with a few simple JavaScript commands.
* Works with all modern desktop browsers (IE11, Edge, Chrome, Firefox, Opera)
* The presentation export is pushed to client browsers as a regular file without any interaction required
* Complete, modern JavaScript solution - no client configuration, plug-ins, or other settings needed!

Additionally, this framework includes a unique Table-To-Slides feature that will reproduce
an HTML Table in 1 or more slides with a single command.

Supported write/output formats:
* PowerPoint 2007+, Open Office XML, Apple Keynote (.PPTX)

Now available on NPM/Node:
* [https://www.npmjs.com/package/pptxgenjs](https://www.npmjs.com/package/pptxgenjs)

**************************************************************************************************

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents**  (*generated with [DocToc](https://github.com/thlorenz/doctoc)*)

- [Demo](#demo)
- [Installation](#installation)
- [Optional Modules](#optional-modules)
- [The Basics](#the-basics)
- [Creating a Presentation](#creating-a-presentation)
- [Table-to-Slides / 1-Click Exports](#table-to-slides--1-click-exports)
  - [TIP:](#tip)
- [In-Depth Examples](#in-depth-examples)
  - [Table Example](#table-example)
  - [Text Example](#text-example)
  - [Shape Example](#shape-example)
  - [Image Example](#image-example)
- [Library Reference](#library-reference)
  - [Presentation Options](#presentation-options)
  - [Available Layouts](#available-layouts)
  - [Creating Slides](#creating-slides)
  - [Text](#text)
    - [Text Options](#text-options)
  - [Table](#table)
    - [Table Options](#table-options)
    - [Cell Options](#cell-options)
  - [Shape](#shape)
    - [Shape Options](#shape-options)
  - [Image](#image)
    - [Image Options](#image-options)
  - [Performance Considerations](#performance-considerations)
- [Bugs & Issues](#bugs-&-issues)
- [License](#license)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

**************************************************************************************************

# Demo
Use JavaScript to Create PowerPoint presentations right from our demo page  
[http://gitbrent.github.io/PptxGenJS](http://gitbrent.github.io/PptxGenJS)

# Installation
PptxGenJS requires only three additional JavaScript libraries to function.

```javascript
<script lang="javascript" src="dist/jquery.min.js"></script>
<script lang="javascript" src="dist/jszip.min.js"></script>
<script lang="javascript" src="dist/filesaver.min.js"></script>
<script lang="javascript" src="dist/pptxgen.js"></script>
```

# Optional Modules
If you are planning on creating Shapes (basically anything other than Text, Tables or rectangles), then you'll want to
include the `pptxgen.shapes.js` library.  It's a complete PowerPoint PPTX Shape object array thanks to the
[officegen project](https://github.com/Ziv-Barber/officegen)
```javascript
<script lang="javascript" src="dist/pptxgen.shapes.js"></script>
```

For times when a plain white slide won't due, why not create a Slide Master? (especially useful for corporate environments).
See the one in the examples folder to get started
```javascript
<script lang="javascript" src="dist/pptxgen.masters.js"></script>
```

**************************************************************************************************
# The Basics
* Presentations are composed of 1 or more Slides
* Options are passed via objects (e.g.: `{ x:1.5, y:2.5, font_size:18 }`)
* Shape dimensions and locations are passed in inches
* Not much other than X and Y locations are required are required for most objects

# Creating a Presentation
Creating a Presentation is as easy as 1-2-3:

1. Add a Slide  
2. Add any Shapes, Text or Tables  
3. Save the Presentation  

```javascript
var slide = pptx.addNewSlide();
slide.addText('Hello World!', { x:0.5, y:0.7, font_size:18, color:'0000FF' });
pptx.save('Sample Presentation');
```

**************************************************************************************************
# Table-to-Slides / 1-Click Exports
* With the unique `addSlidesForTable()` function, you can reproduce an HTML table - background
colors, borders, fonts, padding, etc. - with a single function call.
* The function will detect margins (based on Master Slide layout or parameters) and will create Slides as needed
* All you have to do is throw a table at the function and you're done!

```javascript
// STEP 1: Instantiate new PptxGenJS instance
var pptx = new PptxGenJS();

// STEP 2: Set slide size/layout
pptx.setLayout('LAYOUT_16x9');

// STEP 3: Pass table to addSlidesForTable function to produce 1-N slides
pptx.addSlidesForTable('tabAutoPaging');

// STEP 4: Export Presentation
pptx.save('Table2SlidesDemo');
```

What about cases where you have a specific Slide Master or Corporate layout to adhere to?  
No problem!  
Simply pass the Slide Master name and all shapes/text will appear on the output Slides.  Even better,
your slide layout/size and margins are already defined as well, so you end up with code you can just inline
into a button and place next to any table on your site.

```javascript
<input type="button" value="Export to PPTX" onclick="{ var pptx = new PptxGenJS(); pptx.addSlidesForTable('tableId',{ master:pptx.masters.MASTER_SLIDE }); pptx.save(); }">
```
## TIP:
* Placing a button like this into a WebPart is a great way to add "Export to PowerPoint" functionality
to SharePoint/Office365. (You'd also need to add the 4 `<script>` includes in the same or another WebPart)

**************************************************************************************************
# In-Depth Examples
<commit_msg>Doc update<commit_after># PptxGenJS
Client-side JavaScript framework that produces PowerPoint (pptx) presentations.

By including the PptxGenJS framework inside an HTML page, you have the ability to quickly and
easily produce PowerPoint presentations with a few simple JavaScript commands.
* Works with all modern desktop browsers (IE11, Edge, Chrome, Firefox, Opera)
* The presentation export is pushed to client browsers as a regular file without any interaction required
* Complete, modern JavaScript solution - no client configuration, plug-ins, or other settings needed!

Additionally, this framework includes a unique Table-To-Slides feature that will reproduce
an HTML Table in 1 or more slides with a single command.

Supported write/output formats:
* PowerPoint 2007+, Open Office XML, Apple Keynote (.PPTX)

Now available on NPM/Node:
* [https://www.npmjs.com/package/pptxgenjs](https://www.npmjs.com/package/pptxgenjs)

**************************************************************************************************

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents**  (*generated with [DocToc](https://github.com/thlorenz/doctoc)*)

- [Demo](#demo)
- [Installation](#installation)
- [Optional Modules](#optional-modules)
- [The Basics](#the-basics)
- [Creating a Presentation](#creating-a-presentation)
- [Table-to-Slides / 1-Click Exports](#table-to-slides--1-click-exports)
  - [TIP:](#tip)
- [In-Depth Examples](#in-depth-examples)
  - [Table Example](#table-example)
  - [Text Example](#text-example)
  - [Shape Example](#shape-example)
  - [Image Example](#image-example)
- [Library Reference](#library-reference)
  - [Presentation Options](#presentation-options)
  - [Available Layouts](#available-layouts)
  - [Creating Slides](#creating-slides)
  - [Text](#text)
    - [Text Options](#text-options)
  - [Table](#table)
    - [Table Options](#table-options)
    - [Cell Options](#cell-options)
  - [Shape](#shape)
    - [Shape Options](#shape-options)
  - [Image](#image)
    - [Image Options](#image-options)
  - [Performance Considerations](#performance-considerations)
- [Bugs & Issues](#bugs-&-issues)
- [License](#license)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

**************************************************************************************************

# Demo
Use JavaScript to Create PowerPoint presentations right from our demo page  
[http://gitbrent.github.io/PptxGenJS](http://gitbrent.github.io/PptxGenJS)

# Installation
PptxGenJS requires only three additional JavaScript libraries to function.

```javascript
<script lang="javascript" src="dist/jquery.min.js"></script>
<script lang="javascript" src="dist/jszip.min.js"></script>
<script lang="javascript" src="dist/filesaver.min.js"></script>
<script lang="javascript" src="dist/pptxgen.js"></script>
```

# Optional Modules
If you are planning on creating Shapes (basically anything other than Text, Tables or rectangles), then you'll want to
include the `pptxgen.shapes.js` library.  It's a complete PowerPoint PPTX Shape object array thanks to the
[officegen project](https://github.com/Ziv-Barber/officegen)
```javascript
<script lang="javascript" src="dist/pptxgen.shapes.js"></script>
```

For times when a plain white slide won't due, why not create a Slide Master? (especially useful for corporate environments).
See the one in the examples folder to get started
```javascript
<script lang="javascript" src="dist/pptxgen.masters.js"></script>
```

**************************************************************************************************
# The Basics
* Presentations are composed of 1 or more Slides
* Options are passed via objects (e.g.: `{ x:1.5, y:2.5, font_size:18 }`)
* Shape dimensions and locations are passed in inches
* Not much other than X and Y locations are required are required for most objects

# Creating a Presentation
Creating a Presentation is as easy as 1-2-3:

1. Add a Slide  
2. Add any Shapes, Text or Tables  
3. Save the Presentation  

```javascript
var slide = pptx.addNewSlide();
slide.addText('Hello World!', { x:0.5, y:0.7, font_size:18, color:'0000FF' });
pptx.save('Sample Presentation');
```

**************************************************************************************************
# Table-to-Slides / 1-Click Exports
* With the unique `addSlidesForTable()` function, you can reproduce an HTML table - background
colors, borders, fonts, padding, etc. - with a single function call.
* The function will detect margins (based on Master Slide layout or parameters) and will create Slides as needed
* All you have to do is throw a table at the function and you're done!

```javascript
// STEP 1: Instantiate new PptxGenJS instance
var pptx = new PptxGenJS();

// STEP 2: Set slide size/layout
pptx.setLayout('LAYOUT_16x9');

// STEP 3: Pass table to addSlidesForTable function to produce 1-N slides
pptx.addSlidesForTable('tabAutoPaging');

// STEP 4: Export Presentation
pptx.save('Table2SlidesDemo');
```

What about cases where you have a specific Slide Master or Corporate layout to adhere to?  
No problem!  
Simply pass the Slide Master name and all shapes/text will appear on the output Slides.  Even better,
your slide layout/size and margins are already defined as well, so you end up with code you can just inline
into a button and place next to any table on your site.

```javascript
<input type="button" value="Export to PPTX" onclick="{ var pptx = new PptxGenJS(); pptx.addSlidesForTable('tableId',{ master:pptx.masters.MASTER_SLIDE }); pptx.save(); }">
```

Note: Slide background color/image can be overridden on a per-slide basis when needed.
```javascript
var slide3 = pptx.addNewSlide( pptx.masters.MASTER_SLIDE, { bkgd:'0088CC'} );
```

## TIP:
* Placing a button like this into a WebPart is a great way to add "Export to PowerPoint" functionality
to SharePoint. (You'd also need to add the 4 `<script>` includes in the same or another WebPart)

**************************************************************************************************
# In-Depth Examples

{'fraction_non_alphanumeric': 0.18855273916598528, 'fraction_numerical': 0.0076860179885527395, 'mean_word_length': 5.202332657200811, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, 'https://': 8, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1231304', 'n_tokens_mistral': 3647, 'n_tokens_neox': 3328, 'n_words': 1232}