pptxtojson 2.0.4 → 2.0.5
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 +352 -337
- package/README_zh.md +352 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/fill.js +56 -12
- package/src/pptxtojson.js +41 -20
- package/src/shape.js +9 -0
package/README.md
CHANGED
|
@@ -1,337 +1,352 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/pptxtojson)
|
|
4
|
-
[](https://www.npmjs.com/package/pptxtojson)
|
|
5
|
-
[](https://github.com/pipipi-pikachu/pptxtojson/issues)
|
|
6
|
-
[](https://www.github.com/pipipi-pikachu/pptxtojson/blob/master/LICENSE)
|
|
7
|
-
[](https://www.github.com/pipipi-pikachu/pptxtojson/stargazers)
|
|
8
|
-
[](https://www.github.com/pipipi-pikachu/pptxtojson/network/members)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
"
|
|
108
|
-
"
|
|
109
|
-
"
|
|
110
|
-
"
|
|
111
|
-
"
|
|
112
|
-
"
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
- `
|
|
138
|
-
- `
|
|
139
|
-
|
|
140
|
-
- `
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
- `
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
-
|
|
162
|
-
|
|
163
|
-
-
|
|
164
|
-
-
|
|
165
|
-
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
-
|
|
183
|
-
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
-
|
|
199
|
-
-
|
|
200
|
-
-
|
|
201
|
-
-
|
|
202
|
-
-
|
|
203
|
-
-
|
|
204
|
-
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
-
|
|
209
|
-
-
|
|
210
|
-
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
-
|
|
214
|
-
-
|
|
215
|
-
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
-
|
|
221
|
-
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
-
|
|
225
|
-
-
|
|
226
|
-
-
|
|
227
|
-
-
|
|
228
|
-
-
|
|
229
|
-
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
-
|
|
233
|
-
-
|
|
234
|
-
-
|
|
235
|
-
-
|
|
236
|
-
-
|
|
237
|
-
-
|
|
238
|
-
-
|
|
239
|
-
-
|
|
240
|
-
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
-
|
|
244
|
-
-
|
|
245
|
-
-
|
|
246
|
-
-
|
|
247
|
-
-
|
|
248
|
-
-
|
|
249
|
-
-
|
|
250
|
-
-
|
|
251
|
-
-
|
|
252
|
-
-
|
|
253
|
-
-
|
|
254
|
-
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
-
|
|
258
|
-
-
|
|
259
|
-
-
|
|
260
|
-
-
|
|
261
|
-
-
|
|
262
|
-
-
|
|
263
|
-
-
|
|
264
|
-
-
|
|
265
|
-
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
-
|
|
270
|
-
-
|
|
271
|
-
-
|
|
272
|
-
-
|
|
273
|
-
-
|
|
274
|
-
-
|
|
275
|
-
-
|
|
276
|
-
-
|
|
277
|
-
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
-
|
|
284
|
-
-
|
|
285
|
-
-
|
|
286
|
-
-
|
|
287
|
-
-
|
|
288
|
-
-
|
|
289
|
-
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
-
|
|
296
|
-
-
|
|
297
|
-
-
|
|
298
|
-
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
-
|
|
305
|
-
-
|
|
306
|
-
-
|
|
307
|
-
-
|
|
308
|
-
-
|
|
309
|
-
-
|
|
310
|
-
-
|
|
311
|
-
|
|
312
|
-
-
|
|
313
|
-
-
|
|
314
|
-
-
|
|
315
|
-
-
|
|
316
|
-
-
|
|
317
|
-
-
|
|
318
|
-
-
|
|
319
|
-
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
-
|
|
326
|
-
-
|
|
327
|
-
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
1
|
+
# 🎨 pptxtojson
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/pptxtojson)
|
|
4
|
+
[](https://www.npmjs.com/package/pptxtojson)
|
|
5
|
+
[](https://github.com/pipipi-pikachu/pptxtojson/issues)
|
|
6
|
+
[](https://www.github.com/pipipi-pikachu/pptxtojson/blob/master/LICENSE)
|
|
7
|
+
[](https://www.github.com/pipipi-pikachu/pptxtojson/stargazers)
|
|
8
|
+
[](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
|
+
- `audioMode`: Controls how audio assets are parsed. Available values: `blob`, `none`. Default: `none`.
|
|
147
|
+
- `blob` means audio `blob` is parsed.
|
|
148
|
+
- `none` means audio content is not parsed.
|
|
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.
|
|
155
|
+
|
|
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 adjustment parameters `keypoints`
|
|
263
|
+
- Element name `name`
|
|
264
|
+
- Auto fit `autoFit`
|
|
265
|
+
- Text inset on four sides `textInset`
|
|
266
|
+
- Hyperlink `link`
|
|
267
|
+
|
|
268
|
+
- Table
|
|
269
|
+
- Type `type='table'`
|
|
270
|
+
- Horizontal coordinate `left`
|
|
271
|
+
- Vertical coordinate `top`
|
|
272
|
+
- Width `width`
|
|
273
|
+
- Height `height`
|
|
274
|
+
- Borders on four sides `borders`
|
|
275
|
+
- Cell styles and data `data`
|
|
276
|
+
- Row heights `rowHeights`
|
|
277
|
+
- Column widths `colWidths`
|
|
278
|
+
|
|
279
|
+
- Chart
|
|
280
|
+
- Type `type='chart'`
|
|
281
|
+
- Horizontal coordinate `left`
|
|
282
|
+
- Vertical coordinate `top`
|
|
283
|
+
- Width `width`
|
|
284
|
+
- Height `height`
|
|
285
|
+
- Chart data `data`
|
|
286
|
+
- Chart theme colors `colors`
|
|
287
|
+
- Chart type `chartType`
|
|
288
|
+
- Bar chart direction `barDir`
|
|
289
|
+
- Whether markers are enabled `marker`
|
|
290
|
+
- Doughnut chart hole size `holeSize`
|
|
291
|
+
- Grouping mode `grouping`
|
|
292
|
+
- Chart style `style`
|
|
293
|
+
|
|
294
|
+
- Video
|
|
295
|
+
- Type `type='video'`
|
|
296
|
+
- Horizontal coordinate `left`
|
|
297
|
+
- Vertical coordinate `top`
|
|
298
|
+
- Width `width`
|
|
299
|
+
- Height `height`
|
|
300
|
+
- Asset reference path `ref`
|
|
301
|
+
- Video blob `blob`
|
|
302
|
+
|
|
303
|
+
- Audio
|
|
304
|
+
- Type `type='audio'`
|
|
305
|
+
- Horizontal coordinate `left`
|
|
306
|
+
- Vertical coordinate `top`
|
|
307
|
+
- Width `width`
|
|
308
|
+
- Height `height`
|
|
309
|
+
- Asset reference path `ref`
|
|
310
|
+
- Audio blob `blob`
|
|
311
|
+
|
|
312
|
+
- Formula
|
|
313
|
+
- Type `type='math'`
|
|
314
|
+
- Horizontal coordinate `left`
|
|
315
|
+
- Vertical coordinate `top`
|
|
316
|
+
- Width `width`
|
|
317
|
+
- Height `height`
|
|
318
|
+
- Formula image reference path `picRef`
|
|
319
|
+
- Formula image base64 `picBase64`
|
|
320
|
+
- Formula image blob `picBlob`
|
|
321
|
+
- LaTeX expression (only common structures are supported) `latex`
|
|
322
|
+
- Text (exists when text and formulas are mixed) `text`
|
|
323
|
+
|
|
324
|
+
- SmartArt
|
|
325
|
+
- Type `type='diagram'`
|
|
326
|
+
- Horizontal coordinate `left`
|
|
327
|
+
- Vertical coordinate `top`
|
|
328
|
+
- Width `width`
|
|
329
|
+
- Height `height`
|
|
330
|
+
- Child elements `elements`
|
|
331
|
+
- Text list (text content list in SmartArt) `textList`
|
|
332
|
+
|
|
333
|
+
- Group
|
|
334
|
+
- Type `type='group'`
|
|
335
|
+
- Horizontal coordinate `left`
|
|
336
|
+
- Vertical coordinate `top`
|
|
337
|
+
- Width `width`
|
|
338
|
+
- Height `height`
|
|
339
|
+
- Child elements `elements`
|
|
340
|
+
|
|
341
|
+
### See more detailed types here 👇
|
|
342
|
+
[https://github.com/pipipi-pikachu/pptxtojson/blob/master/dist/index.d.ts](https://github.com/pipipi-pikachu/pptxtojson/blob/master/dist/index.d.ts)
|
|
343
|
+
|
|
344
|
+
# 🙏 Acknowledgements
|
|
345
|
+
pptxtojson refers heavily to the implementations of [PPTX2HTML](https://github.com/g21589/PPTX2HTML) and [PPTXjs](https://github.com/meshesha/PPTXjs).
|
|
346
|
+
|
|
347
|
+
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.
|
|
348
|
+
|
|
349
|
+
Issues and PRs with more PPTX samples, parsing scenarios, and improvement suggestions are welcome.
|
|
350
|
+
|
|
351
|
+
# 📄 License
|
|
352
|
+
MIT License | Copyright © 2020-PRESENT [pipipi-pikachu](https://github.com/pipipi-pikachu)
|