pptxtojson 1.2.1 → 1.3.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
@@ -161,10 +161,10 @@ document.querySelector('input').addEventListener('change', evt => {
161
161
  - 垂直坐标 `top`
162
162
  - 宽度 `width`
163
163
  - 高度 `height`
164
- - 边框颜色 `borderColor`
165
- - 边框宽度 `borderWidth`
166
- - 边框类型(实线、点线、虚线) `borderType`
164
+ - 边框(4边) `borders`
167
165
  - 表格数据 `data`
166
+ - 行高 `rowHeights`
167
+ - 列宽 `colWidths`
168
168
 
169
169
  ##### 图表
170
170
  - 类型 `type='chart'`
@@ -198,13 +198,14 @@ document.querySelector('input').addEventListener('change', evt => {
198
198
  - 高度 `height`
199
199
  - 音频blob `blob`
200
200
 
201
- ##### 公式(仅支持常见结构)
201
+ ##### 公式
202
202
  - 类型 `type='math'`
203
203
  - 水平坐标 `left`
204
204
  - 垂直坐标 `top`
205
205
  - 宽度 `width`
206
206
  - 高度 `height`
207
- - LaTeX表达式 `latex`
207
+ - 公式图片 `picBase64`
208
+ - LaTeX表达式(仅支持常见结构) `latex`
208
209
 
209
210
  ##### Smart图
210
211
  - 类型 `type='diagram'`
@@ -227,14 +228,7 @@ document.querySelector('input').addEventListener('change', evt => {
227
228
 
228
229
  # 🙏 感谢
229
230
  本仓库大量参考了 [PPTX2HTML](https://github.com/g21589/PPTX2HTML) 和 [PPTXjs](https://github.com/meshesha/PPTXjs) 的实现。
230
- > 与它们不同的是,PPTX2HTML 和 PPTXjs 是将PPT文件转换为能够运行的 HTML 页面,而 pptxtojson 做的是将PPT文件转换为干净的 JSON 数据
231
+ > 与它们不同的是:PPTX2HTML 和 PPTXjs 是将PPT文件转换为能够运行的 HTML 页面,而 pptxtojson 做的是将PPT文件转换为干净的 JSON 数据,且在原有基础上进行了大量优化(包括代码质量和提取信息准确度)。
231
232
 
232
233
  # 📄 开源协议
233
- MIT License | Copyright © 2020-PRESENT [pipipi-pikachu](https://github.com/pipipi-pikachu)
234
-
235
- # ☕ 打赏
236
- 如果该项目帮到了您,还请您不吝打赏!
237
-
238
- <p align="left">
239
- <img src='/dist/wx.png' />
240
- </p>
234
+ MIT License | Copyright © 2020-PRESENT [pipipi-pikachu](https://github.com/pipipi-pikachu)
package/dist/index.d.ts CHANGED
@@ -32,6 +32,12 @@ export interface GradientFill {
32
32
 
33
33
  export type Fill = ColorFill | ImageFill | GradientFill
34
34
 
35
+ export interface Border {
36
+ borderColor: string
37
+ borderWidth: number
38
+ borderType:'solid' | 'dashed' | 'dotted'
39
+ }
40
+
35
41
  export interface Shape {
36
42
  type: 'shape'
37
43
  left: number
@@ -99,6 +105,12 @@ export interface TableCell {
99
105
  fillColor?: string
100
106
  fontColor?: string
101
107
  fontBold?: boolean
108
+ borders: {
109
+ top?: Border
110
+ bottom?: Border
111
+ left?: Border
112
+ right?: Border
113
+ }
102
114
  }
103
115
  export interface Table {
104
116
  type: 'table'
@@ -107,10 +119,15 @@ export interface Table {
107
119
  width: number
108
120
  height: number
109
121
  data: TableCell[][]
110
- borderColor: string
111
- borderWidth: number
112
- borderType: 'solid' | 'dashed' | 'dotted'
122
+ borders: {
123
+ top?: Border
124
+ bottom?: Border
125
+ left?: Border
126
+ right?: Border
127
+ }
113
128
  order: number
129
+ rowHeights: number[]
130
+ colWidths: number[]
114
131
  }
115
132
 
116
133
  export type ChartType = 'lineChart' |
@@ -209,6 +226,7 @@ export interface Math {
209
226
  width: number
210
227
  height: number
211
228
  latex: string
229
+ picBase64: string
212
230
  order: number
213
231
  }
214
232