pptxtojson 1.0.1 → 1.0.2
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 +9 -5
- package/dist/index.d.ts +5 -2
- 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/fontStyle.js +1 -1
- package/src/pptxtojson.js +12 -3
- package/src/table.js +45 -4
package/README.md
CHANGED
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
|
|
4
4
|
> 与其他的pptx文件解析工具的最大区别在于:
|
|
5
5
|
> 1. 直接运行在浏览器端;
|
|
6
|
-
> 2. 解析结果是**可读**的 JSON 数据,而不仅仅是把 XML
|
|
6
|
+
> 2. 解析结果是**可读**的 JSON 数据,而不仅仅是把 XML 文件内容原样翻译成难以理解的 JSON。
|
|
7
7
|
|
|
8
8
|
在线DEMO:https://pipipi-pikachu.github.io/pptxtojson/
|
|
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
|
-
|
|
14
|
+
但如果你只是需要提取PPT文件的文本内容和媒体资源信息,对排版精准度/样式信息没有特别高的要求,那么 pptxtojson 可能会对你有一些帮助。
|
|
15
15
|
|
|
16
16
|
### 📏 长度值单位
|
|
17
17
|
输出的JSON中,所有数值长度值单位都为`pt`(point)
|
|
@@ -158,7 +158,10 @@ document.querySelector('input').addEventListener('change', evt => {
|
|
|
158
158
|
| left | number | 水平坐标
|
|
159
159
|
| top | number | 垂直坐标
|
|
160
160
|
| width | number | 宽度
|
|
161
|
-
| height | number | 高度
|
|
161
|
+
| height | number | 高度
|
|
162
|
+
| borderColor | string | 边框颜色
|
|
163
|
+
| borderWidth | number | 边框宽度
|
|
164
|
+
| borderType | 'solid' 丨 'dashed' 丨 'dotted' | 边框类型
|
|
162
165
|
| data | TableCell[][] | 表格数据
|
|
163
166
|
|
|
164
167
|
#### 图表
|
|
@@ -222,7 +225,8 @@ document.querySelector('input').addEventListener('change', evt => {
|
|
|
222
225
|
[https://github.com/pipipi-pikachu/pptxtojson/blob/master/dist/index.d.ts](https://github.com/pipipi-pikachu/pptxtojson/blob/master/dist/index.d.ts)
|
|
223
226
|
|
|
224
227
|
# 🙏 感谢
|
|
225
|
-
|
|
228
|
+
本仓库大量参考了 [PPTX2HTML](https://github.com/g21589/PPTX2HTML) 和 [PPTXjs](https://github.com/meshesha/PPTXjs) 的实现。
|
|
229
|
+
> 与它们不同的是,PPTX2HTML 和 PPTXjs 是将PPT文件转换为能够运行的 HTML 页面,而 pptxtojson 做的是将PPT文件转换为干净的 JSON 数据
|
|
226
230
|
|
|
227
231
|
# 📄 开源协议
|
|
228
232
|
MIT License | Copyright © 2020-PRESENT [pipipi-pikachu](https://github.com/pipipi-pikachu)
|
package/dist/index.d.ts
CHANGED
|
@@ -64,8 +64,8 @@ export interface TableCell {
|
|
|
64
64
|
text: string
|
|
65
65
|
rowSpan?: number
|
|
66
66
|
colSpan?: number
|
|
67
|
-
vMerge?:
|
|
68
|
-
hMerge?:
|
|
67
|
+
vMerge?: number
|
|
68
|
+
hMerge?: number
|
|
69
69
|
fillColor?: string
|
|
70
70
|
fontColor?: string
|
|
71
71
|
fontBold?: boolean
|
|
@@ -77,6 +77,9 @@ export interface Table {
|
|
|
77
77
|
width: number
|
|
78
78
|
height: number
|
|
79
79
|
data: TableCell[][]
|
|
80
|
+
borderColor: string
|
|
81
|
+
borderWidth: number
|
|
82
|
+
borderType: 'solid' | 'dashed' | 'dotted'
|
|
80
83
|
}
|
|
81
84
|
|
|
82
85
|
export type ChartType = 'lineChart' |
|