pptxtojson 1.3.2 → 1.5.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 +8 -5
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- 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/index.html +2 -2
- package/package.json +1 -1
- package/rollup.config.js +5 -0
- package/src/fill.js +4 -2
- package/src/pptxtojson.js +20 -1
- package/src/shapePath.js +4635 -0
- package/src/utils.js +4 -1
package/README.md
CHANGED
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
|
|
10
10
|
# 🎯 注意事项
|
|
11
11
|
### ⚒️ 使用场景
|
|
12
|
-
本仓库诞生于项目 [PPTist](https://github.com/pipipi-pikachu/PPTist) ,希望为其“导入 .pptx 文件功能”提供一个参考示例。不过就目前来说,解析出来的PPT
|
|
12
|
+
本仓库诞生于项目 [PPTist](https://github.com/pipipi-pikachu/PPTist) ,希望为其“导入 .pptx 文件功能”提供一个参考示例。不过就目前来说,解析出来的PPT信息与源文件在样式上还是存在差异。
|
|
13
13
|
|
|
14
|
-
但如果你只是需要提取PPT
|
|
14
|
+
但如果你只是需要提取PPT文件的文本内容、媒体资源信息、结构信息等,或者对排版/样式精准度没有特别高的要求,那么 pptxtojson 可能会对你有帮助。
|
|
15
15
|
|
|
16
16
|
### 📏 长度值单位
|
|
17
17
|
输出的JSON中,所有数值长度值单位都为`pt`(point)
|
|
@@ -23,6 +23,8 @@ npm install pptxtojson
|
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
# 💿用法
|
|
26
|
+
|
|
27
|
+
### 浏览器
|
|
26
28
|
```html
|
|
27
29
|
<input type="file" accept="application/vnd.openxmlformats-officedocument.presentationml.presentation"/>
|
|
28
30
|
```
|
|
@@ -42,8 +44,8 @@ document.querySelector('input').addEventListener('change', evt => {
|
|
|
42
44
|
})
|
|
43
45
|
```
|
|
44
46
|
|
|
47
|
+
### 输出示例
|
|
45
48
|
```javascript
|
|
46
|
-
// 输出示例
|
|
47
49
|
{
|
|
48
50
|
"slides": [
|
|
49
51
|
{
|
|
@@ -158,7 +160,7 @@ document.querySelector('input').addEventListener('change', evt => {
|
|
|
158
160
|
- 旋转角度 `rotate`
|
|
159
161
|
- 形状类型 `shapType`
|
|
160
162
|
- 垂直对齐方向 `vAlign`
|
|
161
|
-
-
|
|
163
|
+
- 形状路径 `path`
|
|
162
164
|
- 元素名 `name`
|
|
163
165
|
|
|
164
166
|
##### 表格
|
|
@@ -212,6 +214,7 @@ document.querySelector('input').addEventListener('change', evt => {
|
|
|
212
214
|
- 高度 `height`
|
|
213
215
|
- 公式图片 `picBase64`
|
|
214
216
|
- LaTeX表达式(仅支持常见结构) `latex`
|
|
217
|
+
- 文本(文本和公式混排时存在) `text`
|
|
215
218
|
|
|
216
219
|
##### Smart图
|
|
217
220
|
- 类型 `type='diagram'`
|
|
@@ -234,7 +237,7 @@ document.querySelector('input').addEventListener('change', evt => {
|
|
|
234
237
|
|
|
235
238
|
# 🙏 感谢
|
|
236
239
|
本仓库大量参考了 [PPTX2HTML](https://github.com/g21589/PPTX2HTML) 和 [PPTXjs](https://github.com/meshesha/PPTXjs) 的实现。
|
|
237
|
-
> 与它们不同的是:PPTX2HTML 和 PPTXjs 是将PPT文件转换为能够运行的 HTML 页面,而 pptxtojson 做的是将PPT文件转换为干净的 JSON
|
|
240
|
+
> 与它们不同的是:PPTX2HTML 和 PPTXjs 是将PPT文件转换为能够运行的 HTML 页面,而 pptxtojson 做的是将PPT文件转换为干净的 JSON 数据,且在原有基础上进行了大量优化补充(包括代码质量和提取信息的完整度和准确度)。
|
|
238
241
|
|
|
239
242
|
# 📄 开源协议
|
|
240
243
|
MIT License | Copyright © 2020-PRESENT [pipipi-pikachu](https://github.com/pipipi-pikachu)
|