pptxtojson 2.1.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,355 +1,360 @@
1
- # 🎨 pptxtojson
2
-
3
- [![npm-version](https://img.shields.io/npm/v/pptxtojson)](https://www.npmjs.com/package/pptxtojson)
4
- [![npm download](https://img.shields.io/npm/dm/pptxtojson)](https://www.npmjs.com/package/pptxtojson)
5
- [![GitHub issues](https://img.shields.io/github/issues-closed/pipipi-pikachu/pptxtojson)](https://github.com/pipipi-pikachu/pptxtojson/issues)
6
- [![license](https://img.shields.io/github/license/pipipi-pikachu/pptxtojson)](https://www.github.com/pipipi-pikachu/pptxtojson/blob/master/LICENSE)
7
- [![GitHub stars](https://img.shields.io/github/stars/pipipi-pikachu/pptxtojson)](https://www.github.com/pipipi-pikachu/pptxtojson/stargazers)
8
- [![GitHub forks](https://img.shields.io/github/forks/pipipi-pikachu/pptxtojson)](https://www.github.com/pipipi-pikachu/pptxtojson/network/members)
9
-
10
- [įŽ€äŊ“中文](README_zh.md) | English
11
-
12
- **pptxtojson is a browser-first PPTX parser that converts `.pptx` files into clean, readable, structured JSON.**
13
-
14
- Live demo: https://pipipi-pikachu.github.io/pptxtojson/
15
-
16
- > China mirrors, regularly synced: [Gitee](https://gitee.com/pptist/pptxtojson), [GitCode](https://gitcode.com/pipipi-pikachu/pptxtojson)
17
-
18
- # ✨ Core Capabilities
19
-
20
- - **Browser-side parsing**: Read `.pptx` files directly in the browser, making it suitable for handling local user files without uploading them to a server for conversion.
21
- - **Readable JSON output**: Organize results by slides, elements, assets, themes, and related structures instead of exposing raw Office XML as low-level objects.
22
- - **Built for secondary processing**: Compared with simply converting PPTX to HTML, pptxtojson focuses more on data readability and programmability, making it easier to plug into downstream workflows.
23
-
24
- # 🚀 Use Cases
25
-
26
- - **Web editor import**: Convert PPTX slides and elements into an editable data model, such as [PPTist](https://github.com/pipipi-pikachu/PPTist).
27
- - **Content extraction**: Extract text, speaker notes, media assets, and other information for search, archiving, review, or data analysis.
28
- - **AI document understanding**: Turn presentation content into structured input for summarization, question answering, knowledge-base ingestion, and similar workflows.
29
- - **Custom rendering**: Build your own preview, thumbnails, editing canvas, or conversion pipeline from the JSON result.
30
-
31
- # 🔨 Installation
32
- ```
33
- npm install pptxtojson
34
- ```
35
-
36
- # đŸ’ŋ Usage
37
- ```javascript
38
- parse(file, options = {})
39
- ```
40
-
41
- ### Browser Example
42
- ```html
43
- <input type="file" accept="application/vnd.openxmlformats-officedocument.presentationml.presentation"/>
44
- ```
45
-
46
- ```javascript
47
- import { parse } from 'pptxtojson'
48
-
49
- document.querySelector('input').addEventListener('change', evt => {
50
- const file = evt.target.files[0]
51
-
52
- const reader = new FileReader()
53
- reader.onload = async e => {
54
- const json = await parse(e.target.result, {
55
- imageMode: 'base64',
56
- videoMode: 'none',
57
- audioMode: 'none',
58
- })
59
- console.log(json)
60
- }
61
- reader.readAsArrayBuffer(file)
62
- })
63
- ```
64
-
65
- ### Node.js Example (experimental, v1.5.0+)
66
- ```javascript
67
- const pptxtojson = require('pptxtojson/dist/index.cjs')
68
- const fs = require('fs')
69
-
70
- async function func() {
71
- const buffer = fs.readFileSync('test.pptx')
72
-
73
- const json = await pptxtojson.parse(buffer.buffer, {
74
- imageMode: 'base64',
75
- videoMode: 'none',
76
- audioMode: 'none',
77
- })
78
- console.log(json)
79
- }
80
-
81
- func()
82
- ```
83
-
84
- ### Output Example
85
- ```javascript
86
- {
87
- "slides": [
88
- {
89
- "fill": {
90
- "type": "color",
91
- "value": "#FF0000"
92
- },
93
- "elements": [
94
- {
95
- "left": 0,
96
- "top": 0,
97
- "width": 72,
98
- "height": 72,
99
- "borderColor": "#1F4E79",
100
- "borderWidth": 1,
101
- "borderType": "solid",
102
- "borderStrokeDasharray": 0,
103
- "fill": {
104
- "type": "color",
105
- "value": "#FF0000"
106
- },
107
- "content": "<p style=\"text-align: center;\"><span style=\"font-size: 18pt;font-family: Calibri;\">TEST</span></p>",
108
- "isFlipV": false,
109
- "isFlipH": false,
110
- "rotate": 0,
111
- "vAlign": "mid",
112
- "name": "Rectangle 1",
113
- "type": "shape",
114
- "shapType": "rect"
115
- },
116
- // more...
117
- ],
118
- "layoutElements": [
119
- // more...
120
- ],
121
- "note": "Speaker notes..."
122
- },
123
- // more...
124
- ],
125
- "themeColors": ['#4472C4', '#ED7D31', '#A5A5A5', '#FFC000', '#5B9BD5', '#70AD47'],
126
- "size": {
127
- "width": 960,
128
- "height": 540
129
- }
130
- }
131
- ```
132
-
133
- # 🎲 Options
134
- > `options` is optional. Default values are used when it is not provided.
135
-
136
- - `imageMode`: Controls how image assets are parsed. Available values: `base64`, `blob`, `both`, `none`. Default: `base64`.
137
- - `base64` means only `base64` is parsed.
138
- - `blob` means only `blob` is parsed.
139
- - `both` means both `base64` and `blob` are parsed.
140
- - `none` means image content is not parsed.
141
-
142
- - `videoMode`: Controls how video assets are parsed. Available values: `blob`, `none`. Default: `none`.
143
- - `blob` means video `blob` is parsed.
144
- - `none` means video content is not parsed.
145
-
1
+ # 🎨 pptxtojson
2
+
3
+ [![npm-version](https://img.shields.io/npm/v/pptxtojson)](https://www.npmjs.com/package/pptxtojson)
4
+ [![npm download](https://img.shields.io/npm/dm/pptxtojson)](https://www.npmjs.com/package/pptxtojson)
5
+ [![GitHub issues](https://img.shields.io/github/issues-closed/pipipi-pikachu/pptxtojson)](https://github.com/pipipi-pikachu/pptxtojson/issues)
6
+ [![license](https://img.shields.io/github/license/pipipi-pikachu/pptxtojson)](https://www.github.com/pipipi-pikachu/pptxtojson/blob/master/LICENSE)
7
+ [![GitHub stars](https://img.shields.io/github/stars/pipipi-pikachu/pptxtojson)](https://www.github.com/pipipi-pikachu/pptxtojson/stargazers)
8
+ [![GitHub forks](https://img.shields.io/github/forks/pipipi-pikachu/pptxtojson)](https://www.github.com/pipipi-pikachu/pptxtojson/network/members)
9
+
10
+ [įŽ€äŊ“中文](README_zh.md) | English
11
+
12
+ **pptxtojson is a browser-first PPTX parser that converts `.pptx` files into clean, readable, structured JSON.**
13
+
14
+ Live demo: https://pipipi-pikachu.github.io/pptxtojson/
15
+
16
+ > China mirrors, regularly synced: [Gitee](https://gitee.com/pptist/pptxtojson), [GitCode](https://gitcode.com/pipipi-pikachu/pptxtojson)
17
+
18
+ # ✨ Core Capabilities
19
+
20
+ - **Browser-side parsing**: Read `.pptx` files directly in the browser, making it suitable for handling local user files without uploading them to a server for conversion.
21
+ - **Readable JSON output**: Organize results by slides, elements, assets, themes, and related structures instead of exposing raw Office XML as low-level objects.
22
+ - **Built for secondary processing**: Compared with simply converting PPTX to HTML, pptxtojson focuses more on data readability and programmability, making it easier to plug into downstream workflows.
23
+
24
+ # 🚀 Use Cases
25
+
26
+ - **Web editor import**: Convert PPTX slides and elements into an editable data model, such as [PPTist](https://github.com/pipipi-pikachu/PPTist).
27
+ - **Content extraction**: Extract text, speaker notes, media assets, and other information for search, archiving, review, or data analysis.
28
+ - **AI document understanding**: Turn presentation content into structured input for summarization, question answering, knowledge-base ingestion, and similar workflows.
29
+ - **Custom rendering**: Build your own preview, thumbnails, editing canvas, or conversion pipeline from the JSON result.
30
+
31
+ # 🔨 Installation
32
+ ```
33
+ npm install pptxtojson
34
+ ```
35
+
36
+ # đŸ’ŋ Usage
37
+ ```javascript
38
+ parse(file, options = {})
39
+ ```
40
+
41
+ ### Browser Example
42
+ ```html
43
+ <input type="file" accept="application/vnd.openxmlformats-officedocument.presentationml.presentation"/>
44
+ ```
45
+
46
+ ```javascript
47
+ import { parse } from 'pptxtojson'
48
+
49
+ document.querySelector('input').addEventListener('change', evt => {
50
+ const file = evt.target.files[0]
51
+
52
+ const reader = new FileReader()
53
+ reader.onload = async e => {
54
+ const json = await parse(e.target.result, {
55
+ imageMode: 'base64',
56
+ videoMode: 'none',
57
+ audioMode: 'none',
58
+ })
59
+ console.log(json)
60
+ }
61
+ reader.readAsArrayBuffer(file)
62
+ })
63
+ ```
64
+
65
+ ### Node.js Example (experimental, v1.5.0+)
66
+ ```javascript
67
+ const pptxtojson = require('pptxtojson/dist/index.cjs')
68
+ const fs = require('fs')
69
+
70
+ async function func() {
71
+ const buffer = fs.readFileSync('test.pptx')
72
+
73
+ const json = await pptxtojson.parse(buffer.buffer, {
74
+ imageMode: 'base64',
75
+ videoMode: 'none',
76
+ audioMode: 'none',
77
+ })
78
+ console.log(json)
79
+ }
80
+
81
+ func()
82
+ ```
83
+
84
+ ### Output Example
85
+ ```javascript
86
+ {
87
+ "slides": [
88
+ {
89
+ "fill": {
90
+ "type": "color",
91
+ "value": "#FF0000"
92
+ },
93
+ "elements": [
94
+ {
95
+ "left": 0,
96
+ "top": 0,
97
+ "width": 72,
98
+ "height": 72,
99
+ "borderColor": "#1F4E79",
100
+ "borderWidth": 1,
101
+ "borderType": "solid",
102
+ "borderStrokeDasharray": 0,
103
+ "fill": {
104
+ "type": "color",
105
+ "value": "#FF0000"
106
+ },
107
+ "content": "<p style=\"text-align: center;\"><span style=\"font-size: 18pt;font-family: Calibri;\">TEST</span></p>",
108
+ "isFlipV": false,
109
+ "isFlipH": false,
110
+ "rotate": 0,
111
+ "vAlign": "mid",
112
+ "name": "Rectangle 1",
113
+ "type": "shape",
114
+ "shapType": "rect"
115
+ },
116
+ // more...
117
+ ],
118
+ "layoutElements": [
119
+ // more...
120
+ ],
121
+ "note": "Speaker notes..."
122
+ },
123
+ // more...
124
+ ],
125
+ "themeColors": ['#4472C4', '#ED7D31', '#A5A5A5', '#FFC000', '#5B9BD5', '#70AD47'],
126
+ "size": {
127
+ "width": 960,
128
+ "height": 540
129
+ }
130
+ }
131
+ ```
132
+
133
+ # 🎲 Options
134
+ > `options` is optional. Default values are used when it is not provided.
135
+
136
+ - `imageMode`: Controls how image assets are parsed. Available values: `base64`, `blob`, `both`, `none`. Default: `base64`.
137
+ - `base64` means only `base64` is parsed.
138
+ - `blob` means only `blob` is parsed.
139
+ - `both` means both `base64` and `blob` are parsed.
140
+ - `none` means image content is not parsed.
141
+
142
+ - `videoMode`: Controls how video assets are parsed. Available values: `blob`, `none`. Default: `none`.
143
+ - `blob` means video `blob` is parsed.
144
+ - `none` means video content is not parsed.
145
+
146
146
  - `audioMode`: Controls how audio assets are parsed. Available values: `blob`, `none`. Default: `none`.
147
147
  - `blob` means audio `blob` is parsed.
148
148
  - `none` means audio content is not parsed.
149
149
 
150
- # đŸŽ¯ Notes
151
-
152
- The current parsing result can achieve roughly 80%+ overall fidelity in layout and styling compared with the source file. For PPTX files manually created and edited from scratch by ordinary users, common page structures and basic styles can even reach 95%+ fidelity.
153
-
154
- However, if the file comes from a complex online template, or if it was created by a highly skilled PowerPoint user with many "advanced techniques" such as complex masters, deeply nested groups, special shape effects, complex gradients, non-standard shapes, or complex SmartArt, the parsing difficulty increases significantly and the fidelity will decrease accordingly. These files are better treated as complex samples for separate evaluation.
150
+ - `singleLineSpacingFactor`: Multiplier applied to percentage-based line spacing (`spcPct`). Default: `1`. Set it to a value such as `1.2` to better approximate PowerPoint's font-dependent single-line spacing in HTML rendering. Absolute point spacing (`spcPts`) is unaffected.
155
151
 
156
- ### Length Units
157
- All numeric length values in the output JSON use `pt` (point) as the unit.
158
-
159
- ### Legacy Version Notes
160
- - In version 0.x, all output length values used px (pixels).
161
- - In version 1.x and earlier:
162
- - Image elements used the `src` field to return base64 data.
163
- - Image fills only returned `picBase64`.
164
- - Video elements might return `blob` or `src`.
165
- - Audio elements only returned `blob`.
166
- - Formula images only returned `picBase64`.
167
-
168
- # 📕 Parsed Properties
169
-
170
- - Slide theme colors `themeColors`
171
-
172
- - Embedded font list `usedFonts`
173
-
174
- - Slide size `size`
175
- - Width `width`
176
- - Height `height`
177
-
178
- - Slides `slides`
179
-
180
- - Speaker notes `note`
181
-
182
- - Slide background fill (color, image, gradient, pattern) `fill`
183
- - Solid color fill `type='color'`
184
- - Image fill `type='image'`
185
- - Gradient fill `type='gradient'`
186
- - Pattern fill `type='pattern'`
187
-
188
- - Slide transition `transition`
189
- - Type `type`
190
- - Duration `duration`
191
- - Direction `direction`
192
-
193
- - Slide elements `elements` / master layout elements `layoutElements`
194
- - Text
195
- - Type `type='text'`
196
- - Horizontal coordinate `left`
197
- - Vertical coordinate `top`
198
- - Width `width`
199
- - Height `height`
200
- - Border color `borderColor`
201
- - Border width `borderWidth`
202
- - Border type (solid, dotted, dashed) `borderType`
203
- - Non-solid border style `borderStrokeDasharray`
204
- - Shadow `shadow`
205
- - Fill (color, image, gradient, pattern) `fill`
206
- - Text content (HTML rich text) `content`:
207
- - Inline styles/structure: font family, font size, color, gradient, underline, strikethrough, italic, bold, character spacing, shadow, superscript/subscript, hyperlink
208
- - Block-level styles/structure: horizontal alignment, line spacing, paragraph spacing, indentation, first-line indentation, bullets, numbered lists
209
- - Vertical flip `isFlipV`
210
- - Horizontal flip `isFlipH`
211
- - Rotation angle `rotate`
212
- - Vertical alignment `vAlign`
213
- - Whether it is vertical text `isVertical`
214
- - Element name `name`
215
- - Auto fit `autoFit`
216
- - Type `type`
217
- - `shape`: the text box height automatically adjusts according to the text content
218
- - `text`: the text box size is fixed, and the font size is automatically scaled to fit the text box (note: when `autoFit` does not exist, the text box size is also fixed, but the font size is not scaled)
219
- - Font scale ratio (only for `type='text'`, default is 1) `fontScale`
220
- - Text inset on four sides `textInset`
221
- - Hyperlink `link`
222
-
223
- - Image
224
- - Type `type='image'`
225
- - Horizontal coordinate `left`
226
- - Vertical coordinate `top`
227
- - Width `width`
228
- - Height `height`
229
- - Border color `borderColor`
230
- - Border width `borderWidth`
231
- - Border type (solid, dotted, dashed) `borderType`
232
- - Non-solid border style `borderStrokeDasharray`
233
- - Crop shape `geom`
234
- - Crop rectangle `rect`
235
- - Asset reference path `ref`
236
- - Image base64 `base64`
237
- - Image blob `blob`
238
- - Rotation angle `rotate`
239
- - Filters `filters`
240
- - Hyperlink `link`
241
-
242
- - Shape
243
- - Type `type='shape'`
244
- - Horizontal coordinate `left`
245
- - Vertical coordinate `top`
246
- - Width `width`
247
- - Height `height`
248
- - Border color `borderColor`
249
- - Border width `borderWidth`
250
- - Border type (solid, dotted, dashed) `borderType`
251
- - Non-solid border style `borderStrokeDasharray`
252
- - Shadow `shadow`
253
- - Fill (color, image, gradient, pattern) `fill`
254
- - Stroke only (no fill) `strokeOnly`
255
- - Text content (HTML rich text, same as text elements) `content`
256
- - Vertical flip `isFlipV`
257
- - Horizontal flip `isFlipH`
258
- - Rotation angle `rotate`
259
- - Shape type `shapType`
260
- - Vertical alignment `vAlign`
261
- - Shape path `path`
262
- - Shape path viewBox `pathViewBox`
263
- - Line head endpoint `headEnd`
264
- - Line tail endpoint `tailEnd`
265
- - Shape adjustment parameters `keypoints`
266
- - Element name `name`
267
- - Auto fit `autoFit`
268
- - Text inset on four sides `textInset`
269
- - Hyperlink `link`
270
-
271
- - Table
272
- - Type `type='table'`
273
- - Horizontal coordinate `left`
274
- - Vertical coordinate `top`
275
- - Width `width`
276
- - Height `height`
277
- - Borders on four sides `borders`
278
- - Cell styles and data `data`
279
- - Row heights `rowHeights`
280
- - Column widths `colWidths`
281
-
282
- - Chart
283
- - Type `type='chart'`
284
- - Horizontal coordinate `left`
285
- - Vertical coordinate `top`
286
- - Width `width`
287
- - Height `height`
288
- - Chart data `data`
289
- - Chart theme colors `colors`
290
- - Chart type `chartType`
291
- - Bar chart direction `barDir`
292
- - Whether markers are enabled `marker`
293
- - Doughnut chart hole size `holeSize`
294
- - Grouping mode `grouping`
295
- - Chart style `style`
296
-
297
- - Video
298
- - Type `type='video'`
299
- - Horizontal coordinate `left`
300
- - Vertical coordinate `top`
301
- - Width `width`
302
- - Height `height`
303
- - Asset reference path `ref`
304
- - Video blob `blob`
305
-
306
- - Audio
307
- - Type `type='audio'`
308
- - Horizontal coordinate `left`
309
- - Vertical coordinate `top`
310
- - Width `width`
311
- - Height `height`
312
- - Asset reference path `ref`
313
- - Audio blob `blob`
314
-
315
- - Formula
316
- - Type `type='math'`
317
- - Horizontal coordinate `left`
318
- - Vertical coordinate `top`
319
- - Width `width`
320
- - Height `height`
321
- - Formula image reference path `picRef`
322
- - Formula image base64 `picBase64`
323
- - Formula image blob `picBlob`
324
- - LaTeX expression (only common structures are supported) `latex`
325
- - Text (exists when text and formulas are mixed) `text`
326
-
327
- - SmartArt
328
- - Type `type='diagram'`
329
- - Horizontal coordinate `left`
330
- - Vertical coordinate `top`
331
- - Width `width`
332
- - Height `height`
333
- - Child elements `elements`
334
- - Text list (text content list in SmartArt) `textList`
335
-
336
- - Group
337
- - Type `type='group'`
338
- - Horizontal coordinate `left`
339
- - Vertical coordinate `top`
340
- - Width `width`
341
- - Height `height`
342
- - Child elements `elements`
343
-
344
- ### See more detailed types here 👇
345
- [https://github.com/pipipi-pikachu/pptxtojson/blob/master/dist/index.d.ts](https://github.com/pipipi-pikachu/pptxtojson/blob/master/dist/index.d.ts)
346
-
347
- # 🙏 Acknowledgements
348
- pptxtojson refers heavily to the implementations of [PPTX2HTML](https://github.com/g21589/PPTX2HTML) and [PPTXjs](https://github.com/meshesha/PPTXjs).
349
-
350
- Unlike those projects, pptxtojson does not aim to convert PPT files into HTML pages. Instead, it outputs clean, readable JSON that is easier to process further, and it includes many optimizations and additions to improve the completeness and accuracy of extracted information.
351
-
352
- Issues and PRs with more PPTX samples, parsing scenarios, and improvement suggestions are welcome.
353
-
354
- # 📄 License
355
- MIT License | Copyright Š 2020-PRESENT [pipipi-pikachu](https://github.com/pipipi-pikachu)
152
+ # đŸŽ¯ Notes
153
+
154
+ The current parsing result can achieve roughly 80%+ overall fidelity in layout and styling compared with the source file. For PPTX files manually created and edited from scratch by ordinary users, common page structures and basic styles can even reach 95%+ fidelity.
155
+
156
+ However, if the file comes from a complex online template, or if it was created by a highly skilled PowerPoint user with many "advanced techniques" such as complex masters, deeply nested groups, special shape effects, complex gradients, non-standard shapes, or complex SmartArt, the parsing difficulty increases significantly and the fidelity will decrease accordingly. These files are better treated as complex samples for separate evaluation.
157
+
158
+ ### Length Units
159
+ All numeric length values in the output JSON use `pt` (point) as the unit.
160
+
161
+ ### Legacy Version Notes
162
+ - In version 0.x, all output length values used px (pixels).
163
+ - In version 1.x and earlier:
164
+ - Image elements used the `src` field to return base64 data.
165
+ - Image fills only returned `picBase64`.
166
+ - Video elements might return `blob` or `src`.
167
+ - Audio elements only returned `blob`.
168
+ - Formula images only returned `picBase64`.
169
+
170
+ # 📕 Parsed Properties
171
+
172
+ - Slide theme colors `themeColors`
173
+
174
+ - Embedded font list `usedFonts`
175
+
176
+ - Slide size `size`
177
+ - Width `width`
178
+ - Height `height`
179
+
180
+ - Slides `slides`
181
+
182
+ - Speaker notes `note`
183
+
184
+ - Slide background fill (color, image, gradient, pattern) `fill`
185
+ - Solid color fill `type='color'`
186
+ - Image fill `type='image'`
187
+ - Gradient fill `type='gradient'`
188
+ - Pattern fill `type='pattern'`
189
+
190
+ - Slide transition `transition`
191
+ - Type `type`
192
+ - Duration `duration`
193
+ - Direction `direction`
194
+
195
+ - Slide elements `elements` / master layout elements `layoutElements`
196
+ - OOXML ID `id`
197
+ - Text
198
+ - Type `type='text'`
199
+ - Horizontal coordinate `left`
200
+ - Vertical coordinate `top`
201
+ - Width `width`
202
+ - Height `height`
203
+ - Border color `borderColor`
204
+ - Border width `borderWidth`
205
+ - Border type (solid, dotted, dashed) `borderType`
206
+ - Non-solid border style `borderStrokeDasharray`
207
+ - Shadow `shadow`
208
+ - Fill (color, image, gradient, pattern) `fill`
209
+ - Text content (HTML rich text) `content`:
210
+ - Inline styles/structure: font family, font size, color, gradient, underline, strikethrough, italic, bold, character spacing, shadow, superscript/subscript, hyperlink
211
+ - Block-level styles/structure: horizontal alignment, line spacing, paragraph spacing, indentation, first-line indentation, bullets, numbered lists
212
+ - Vertical flip `isFlipV`
213
+ - Horizontal flip `isFlipH`
214
+ - Rotation angle `rotate`
215
+ - Vertical alignment `vAlign`
216
+ - Whether text wraps automatically `wrap`
217
+ - Whether it is vertical text `isVertical`
218
+ - Element name `name`
219
+ - Auto fit `autoFit`
220
+ - Type `type`
221
+ - `shape`: the text box height automatically adjusts according to the text content
222
+ - `text`: the text box size is fixed, and the font size is automatically scaled to fit the text box (note: when `autoFit` does not exist, the text box size is also fixed, but the font size is not scaled)
223
+ - Font scale ratio (only for `type='text'`, default is 1) `fontScale`
224
+ - Text inset on four sides `textInset`
225
+ - Hyperlink `link`
226
+
227
+ - Image
228
+ - Type `type='image'`
229
+ - Horizontal coordinate `left`
230
+ - Vertical coordinate `top`
231
+ - Width `width`
232
+ - Height `height`
233
+ - Border color `borderColor`
234
+ - Border width `borderWidth`
235
+ - Border type (solid, dotted, dashed) `borderType`
236
+ - Non-solid border style `borderStrokeDasharray`
237
+ - Crop shape `geom`
238
+ - Crop rectangle `rect`
239
+ - Asset reference path `ref`
240
+ - Image base64 `base64`
241
+ - Image blob `blob`
242
+ - Rotation angle `rotate`
243
+ - Filters `filters`
244
+ - Hyperlink `link`
245
+
246
+ - Shape
247
+ - Type `type='shape'`
248
+ - Horizontal coordinate `left`
249
+ - Vertical coordinate `top`
250
+ - Width `width`
251
+ - Height `height`
252
+ - Border color `borderColor`
253
+ - Border width `borderWidth`
254
+ - Border type (solid, dotted, dashed) `borderType`
255
+ - Non-solid border style `borderStrokeDasharray`
256
+ - Shadow `shadow`
257
+ - Fill (color, image, gradient, pattern) `fill`
258
+ - Stroke only (no fill) `strokeOnly`
259
+ - Text content (HTML rich text, same as text elements) `content`
260
+ - Vertical flip `isFlipV`
261
+ - Horizontal flip `isFlipH`
262
+ - Rotation angle `rotate`
263
+ - Shape type `shapType`
264
+ - Vertical alignment `vAlign`
265
+ - Whether text wraps automatically `wrap`
266
+ - Shape path `path`
267
+ - Shape path viewBox `pathViewBox`
268
+ - Line head endpoint `headEnd`
269
+ - Line tail endpoint `tailEnd`
270
+ - Shape adjustment parameters `keypoints`
271
+ - Element name `name`
272
+ - Auto fit `autoFit`
273
+ - Text inset on four sides `textInset`
274
+ - Hyperlink `link`
275
+
276
+ - Table
277
+ - Type `type='table'`
278
+ - Horizontal coordinate `left`
279
+ - Vertical coordinate `top`
280
+ - Width `width`
281
+ - Height `height`
282
+ - Borders on four sides `borders`
283
+ - Cell styles and data `data`
284
+ - Row heights `rowHeights`
285
+ - Column widths `colWidths`
286
+
287
+ - Chart
288
+ - Type `type='chart'`
289
+ - Horizontal coordinate `left`
290
+ - Vertical coordinate `top`
291
+ - Width `width`
292
+ - Height `height`
293
+ - Chart data `data`
294
+ - Chart theme colors `colors`
295
+ - Chart type `chartType`
296
+ - Bar chart direction `barDir`
297
+ - Whether markers are enabled `marker`
298
+ - Doughnut chart hole size `holeSize`
299
+ - Grouping mode `grouping`
300
+ - Chart style `style`
301
+
302
+ - Video
303
+ - Type `type='video'`
304
+ - Horizontal coordinate `left`
305
+ - Vertical coordinate `top`
306
+ - Width `width`
307
+ - Height `height`
308
+ - Asset reference path `ref`
309
+ - Video blob `blob`
310
+
311
+ - Audio
312
+ - Type `type='audio'`
313
+ - Horizontal coordinate `left`
314
+ - Vertical coordinate `top`
315
+ - Width `width`
316
+ - Height `height`
317
+ - Asset reference path `ref`
318
+ - Audio blob `blob`
319
+
320
+ - Formula
321
+ - Type `type='math'`
322
+ - Horizontal coordinate `left`
323
+ - Vertical coordinate `top`
324
+ - Width `width`
325
+ - Height `height`
326
+ - Formula image reference path `picRef`
327
+ - Formula image base64 `picBase64`
328
+ - Formula image blob `picBlob`
329
+ - LaTeX expression (only common structures are supported) `latex`
330
+ - Text (exists when text and formulas are mixed) `text`
331
+
332
+ - SmartArt
333
+ - Type `type='diagram'`
334
+ - Horizontal coordinate `left`
335
+ - Vertical coordinate `top`
336
+ - Width `width`
337
+ - Height `height`
338
+ - Child elements `elements`
339
+ - Text list (text content list in SmartArt) `textList`
340
+
341
+ - Group
342
+ - Type `type='group'`
343
+ - Horizontal coordinate `left`
344
+ - Vertical coordinate `top`
345
+ - Width `width`
346
+ - Height `height`
347
+ - Child elements `elements`
348
+
349
+ ### See more detailed types here 👇
350
+ [https://github.com/pipipi-pikachu/pptxtojson/blob/master/dist/index.d.ts](https://github.com/pipipi-pikachu/pptxtojson/blob/master/dist/index.d.ts)
351
+
352
+ # 🙏 Acknowledgements
353
+ pptxtojson refers heavily to the implementations of [PPTX2HTML](https://github.com/g21589/PPTX2HTML) and [PPTXjs](https://github.com/meshesha/PPTXjs).
354
+
355
+ Unlike those projects, pptxtojson does not aim to convert PPT files into HTML pages. Instead, it outputs clean, readable JSON that is easier to process further, and it includes many optimizations and additions to improve the completeness and accuracy of extracted information.
356
+
357
+ Issues and PRs with more PPTX samples, parsing scenarios, and improvement suggestions are welcome.
358
+
359
+ # 📄 License
360
+ MIT License | Copyright Š 2020-PRESENT [pipipi-pikachu](https://github.com/pipipi-pikachu)