├── .gitignore ├── LICENSE ├── README.md └── examples ├── .gitignore ├── README.md ├── dist ├── 1.pptx ├── assets │ ├── index-DSa3punm.js │ └── index-IAbd8QG7.css ├── index.html ├── test.pptx ├── vite.svg ├── wx.png └── ~$1.pptx ├── index.html ├── package.json ├── pnpm-lock.yaml ├── public ├── 1.pptx ├── test.pptx ├── vite.svg ├── wx.png └── ~$1.pptx ├── src ├── App.vue ├── assets │ └── vue.svg ├── main.ts └── style.css ├── tsconfig.app.json ├── tsconfig.app.tsbuildinfo ├── tsconfig.json ├── tsconfig.node.json ├── tsconfig.node.tsbuildinfo └── vite.config.ts /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | pnpm-debug.log* 14 | 15 | # Editor directories and files 16 | .idea 17 | .vscode 18 | *.suo 19 | *.ntvs* 20 | *.njsproj 21 | *.sln 22 | *.sw? -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 本项目发布的npm包可免费使用,自用商用均可 2 | 本项目的源码仅供个人学习使用,不得发布到互联网平台中,不得直接修改源码并转为自有项目进行开源 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # pptx-preview 2 | 纯前端实现的pptx.js文件的预览库,支持npm方式安装,支持ES Module方式引入。 3 | 4 | [在线演示](https://501351981.github.io/pptx-preview/examples/dist/) 5 | 6 | 7 | # 使用 8 | 9 | ## 下载 10 | 11 | ```shell 12 | npm i pptx-preview 13 | ``` 14 | 15 | ## 使用示例 16 | 17 | ```javascript 18 | import {init} from 'pptx-preview' 19 | 20 | //调用库的init方法生成一个预览器 21 | let pptxPrviewer = init(document.getElementById('pptx-wrapper'), { 22 | width: 960, 23 | height: 540 24 | }) 25 | 26 | //获取文件或者读取文件,获取文件的 ArrayBuffer格式数据,传给组件进行预览 27 | fetch('test.pptx').then(response=>{ 28 | return response.arrayBuffer() 29 | }).then(res =>{ 30 | //调用预览器的preview方法 31 | pptxPrviewer.preview(res) 32 | }) 33 | ``` 34 | 35 | # 关于授权 36 | 37 | - 本项目发布的npm包可免费使用,自用商用均可 38 | - 本项目的源码仅供个人学习使用,不得发布到互联网平台中,不得直接修改源码并转为自有项目进行开源 39 | 40 | # 支持作者 41 | 42 | 开发这样一个复杂的预览库,需要投入很多的个人时间,作者经常在周末、节假日进行该项目的开发,付出很多精力,如果该项目帮到了您,还请您不吝打赏。 43 | 44 |  45 | 46 | 47 | - 为什么没有开放源码 48 | 49 | 我们都知道,如果一件事情没有收益,那是很难长久的,特别是对于一个大龄程序员来说,花费大量的时间"用爱发电"对大家来说是非常值得尊敬的,而我感觉对家庭来说可能是不道德的,没有收益,没有正反馈,很难把这个库完善下去,我们也看到了,很多开源库已经多年没有更新了。 50 | 51 | 为了更好地实现pptx文件预览的各种细节,本项目需要大家的支持,源码需付费向作者索要,打赏用户(无论多少)均可添加作者微信,交流该库或者前端领域话题。 52 | 53 | 54 | 当然了,也感谢各位大佬的点赞~~ -------------------------------------------------------------------------------- /examples/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist-ssr 12 | *.local 13 | 14 | # Editor directories and files 15 | .vscode/* 16 | !.vscode/extensions.json 17 | .idea 18 | .DS_Store 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | *.sw? 24 | -------------------------------------------------------------------------------- /examples/README.md: -------------------------------------------------------------------------------- 1 | # Vue 3 + TypeScript + Vite 2 | 3 | This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 ` 9 | 10 | 11 |
12 | 13 | 14 |