pptxtojson 1.4.0 → 1.5.1

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
@@ -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文件的文本内容、媒体资源信息、结构信息等,对排版/样式精准度没有特别高的要求,那么 pptxtojson 可能会对你有帮助。
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,23 @@ document.querySelector('input').addEventListener('change', evt => {
42
44
  })
43
45
  ```
44
46
 
47
+ ### Node.js(实验性,1.5.0以上版本)
48
+ ```javascript
49
+ const pptxtojson = require('pptxtojson/dist/index.cjs')
50
+ const fs = require('fs')
51
+
52
+ async function func() {
53
+ const buffer = fs.readFileSync('test.pptx')
54
+
55
+ const json = await pptxtojson.parse(buffer.buffer)
56
+ console.log(json)
57
+ }
58
+
59
+ func()
60
+ ```
61
+
62
+ ### 输出示例
45
63
  ```javascript
46
- // 输出示例
47
64
  {
48
65
  "slides": [
49
66
  {
@@ -158,7 +175,7 @@ document.querySelector('input').addEventListener('change', evt => {
158
175
  - 旋转角度 `rotate`
159
176
  - 形状类型 `shapType`
160
177
  - 垂直对齐方向 `vAlign`
161
- - 路径(自定义形状) `path`
178
+ - 形状路径 `path`
162
179
  - 元素名 `name`
163
180
 
164
181
  ##### 表格