perf: 升级pptxtojson优化导入效果

This commit is contained in:
pipipi-pikachu
2026-06-26 21:59:47 +08:00
parent f1cfabe7f8
commit b50d2e6367
5 changed files with 13 additions and 13 deletions
+2 -2
View File
@@ -37,7 +37,7 @@
> This project is strictly positioned as a Web Slide Editing/Presentation Application. It is not intended to be an ~~AI PPT generator, low-code platform, or image editor~~. The following are the recommendation levels for common use cases:
- **Low-code Platforms / H5 Editors / Image Editors / Whiteboards** (Recommendation: Not Recommended): We suggest choosing open-source projects specifically designed for those purposes.
- **PPT File Preview Tool** (Recommendation: ⭐): The ability to import .pptx files is limited (roughly 80% fidelity). Unless your requirements for preview accuracy are low and you only need basic content display, this is not recommended.
- **PPT File Preview Tool** (Recommendation: ⭐): The ability to import .pptx files is limited (roughly 80%+ fidelity). Unless your requirements for preview accuracy are low and you only need basic content display, this is not recommended.
- **AI PPT Generation Tool** (Recommendation: ⭐⭐): While the project provides basic template-based AIPPT generation, it is not the core focus. As AI technology evolves, the form of AIPPT will continue to change (templates -> HTML webpages -> pure images -> SVG -> ...), and this project will not follow those trends. However, if you only want to build a template-based AIPPT generator, or are willing to extend better generation solutions yourself, PPTist's complete Schema and editing capabilities may be helpful.
- **Office PPT Authoring Tool** (Recommendation: ⭐⭐): PPTist supports many common Office PPT features and basic local .pptx export. However, exports cannot be 100% faithful, and this scenario generally has high requirements for importing .pptx files, while the import capability mentioned above is limited. Choose cautiously unless you can accept imperfect import capabilities.
- **Web Slide Editing/Presentation App** (Recommendation: ⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐): This is the primary use case. The core strengths of PPTist are its editing capabilities and user experience. You can build upon this project to customize or add unique nodes and features tailored to your specific needs, where Office compatibility is not the ultimate goal. **Summary: Our vision is for you to use PPTist to create a presentation product that is distinct from Microsoft Office, rather than just using it as a middleman for editing Office files.**
@@ -59,7 +59,7 @@ Browser access: http://127.0.0.1:5173/
- History (undo, redo)
- Shortcuts
- Right-click menu
- Import: PPTX (overall fidelity ~80%), JSON, pptist files
- Import: PPTX (overall fidelity ~80%+), JSON, pptist files
- Export: PPTX (overall fidelity ~95%+), JSON, images, PDF (print), pptist files
- Template-based AI PPT generation
### Slide Page Editing
+2 -2
View File
@@ -36,7 +36,7 @@
> 本项目定位为一个**Web 幻灯片编辑/演示应用**,而不是~~AIPPT生成工具、低代码平台、H5编辑器、图片编辑器 、白板应用~~等。以下是一些常见使用场景推荐度:
- **低代码平台/H5编辑器/图片编辑器/白板应用**(推荐度:完全不推荐):建议选择匹配度更高的开源项目。
- **PPT文件预览工具**(推荐度:⭐):导入PPTX文件的能力有限(综合来看,大约有80%的还原度),除非你预览样式要求不高,只追求基本的内容展示,否则不建议使用。
- **PPT文件预览工具**(推荐度:⭐):导入PPTX文件的能力有限(综合来看,大约有80%+的还原度),除非你预览样式要求不高,只追求基本的内容展示,否则不建议使用。
- **AIPPT生成工具**(推荐度:⭐⭐):本项目虽然提供了基础的模板式AIPPT生成功能,但并非核心,随着AI技术的发展,AIPPT的形态会不断变化(模板 -> HTML网页 -> 纯图 -> SVG -> ...),本项目不会跟进。但如果你只是想做一个模板式的AIPPT生成工具,或者愿意自行扩展更好的生成方案,那么依托于PPTist完善的Schema和编辑能力,本项目可能会对你有一定的帮助。
- **Office PPT制作工具**(推荐度:⭐⭐):本项目支持大量Office PPT常用功能,也支持基本的导出本地PPTX文件,但毕竟导出功能做不到100%还原,且这种场景下对导入PPTX文件的要求一般也非常高,而前面提到导入PPTX文件的能力有限。因此,除非你能接受不完美的导入能力,否则请谨慎选择。
- **Web 幻灯片编辑/演示应用**(推荐度:⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐):这是最推荐的场景,编辑能力和编辑体验是PPTist最核心的优势,你可以在本项目的基础上,根据自己的需求,定制/新增一些个性化的节点/功能,不以导入导出为最终目的(毕竟这些定制化的东西在Office PPT中是不存在的)。**一句话总结:我更希望你基于PPTist打造一个不同于Office PPT的演示类产品,而不只是做一个Office PPT的编辑中转站。**
@@ -58,7 +58,7 @@ npm run dev
- 历史记录(撤销、重做)
- 快捷键
- 右键菜单
- 导入:PPTX(综合还原度约80%)、JSON、特有 pptist 文件
- 导入:PPTX(综合还原度约80%+)、JSON、特有 pptist 文件
- 导出:PPTX(综合还原度约95%+)、JSON、图片、PDF(打印)、特有 pptist 文件
- 模板式AI生成PPT
### 幻灯片页面编辑
+7 -7
View File
@@ -24,7 +24,7 @@
"number-precision": "^1.6.0",
"pinia": "^3.0.2",
"pptxgenjs": "^3.12.0",
"pptxtojson": "^2.0.4",
"pptxtojson": "^2.0.5",
"prosemirror-commands": "^1.6.0",
"prosemirror-dropcursor": "^1.8.1",
"prosemirror-gapcursor": "^1.3.2",
@@ -4568,9 +4568,9 @@
}
},
"node_modules/pptxtojson": {
"version": "2.0.4",
"resolved": "https://registry.npmmirror.com/pptxtojson/-/pptxtojson-2.0.4.tgz",
"integrity": "sha512-gRRAzu/64qkVg8+7Huyp0vdCRDRbxdpXdLdXVSYZKT1/XcikXWE7FxxlPtdRRiSwhvHqrTDB7Jt0WtwWPfgZvg==",
"version": "2.0.5",
"resolved": "https://registry.npmmirror.com/pptxtojson/-/pptxtojson-2.0.5.tgz",
"integrity": "sha512-FgVpAa4luKubqCMWjsUlznbHFuM2yMNxU4oYv5HlVu3L5pY9zDEt8yHFckL4u4CRymv42MkDPBqptlVvqdw8Hw==",
"license": "MIT",
"dependencies": {
"jszip": "^3.10.1",
@@ -9173,9 +9173,9 @@
}
},
"pptxtojson": {
"version": "2.0.4",
"resolved": "https://registry.npmmirror.com/pptxtojson/-/pptxtojson-2.0.4.tgz",
"integrity": "sha512-gRRAzu/64qkVg8+7Huyp0vdCRDRbxdpXdLdXVSYZKT1/XcikXWE7FxxlPtdRRiSwhvHqrTDB7Jt0WtwWPfgZvg==",
"version": "2.0.5",
"resolved": "https://registry.npmmirror.com/pptxtojson/-/pptxtojson-2.0.5.tgz",
"integrity": "sha512-FgVpAa4luKubqCMWjsUlznbHFuM2yMNxU4oYv5HlVu3L5pY9zDEt8yHFckL4u4CRymv42MkDPBqptlVvqdw8Hw==",
"requires": {
"jszip": "^3.10.1",
"tinycolor2": "1.6.0",
+1 -1
View File
@@ -31,7 +31,7 @@
"number-precision": "^1.6.0",
"pinia": "^3.0.2",
"pptxgenjs": "^3.12.0",
"pptxtojson": "^2.0.4",
"pptxtojson": "^2.0.5",
"prosemirror-commands": "^1.6.0",
"prosemirror-dropcursor": "^1.8.1",
"prosemirror-gapcursor": "^1.3.2",
+1 -1
View File
@@ -926,7 +926,7 @@ export default () => {
const pattern: string | undefined = el.fill?.type === 'image' ? el.fill.value.base64 : undefined
const fill = el.fill?.type === 'color' ? el.fill.value : ''
const fill = (!el.strokeOnly && el.fill?.type === 'color') ? el.fill.value : ''
const metrics = getParagraphMetrics(el.content, ratio)