1 Star 0 Fork 15

Hankin-han / jPreview

forked from Raingad / jPreview 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

jPreview

介绍

一款纯JQ实现的预览插件,支持office文档,图片,音乐,视频,pdf等常用的文件!部分不支持的文档采用officeOnline在线预览。

支持doc、docx、ppt、pptx、wps、xls、xlsx、pdf、mp4、mp3、jpg、png等常用的文件。

体验地址:https://raingad.gitee.io/j-preview/

体验链接

https://raingad.gitee.io/j-preview/preview.html?src=你的文件地址

其他文件支持持续更新中...

软件架构

jpreview/
    ├─source         # 预览资源库,使用时只需要使用static文件内的内容即可
    ├─static         # 静态资源库
    │  └─jPreview.js # 核心文件
    ├─index.html     # demo
    └─preview.html   # 实现预览的页面

使用说明

  1. 引入Jquery,和主文件
<!-- css -->
<link rel="stylesheet" href="static/common/css/main.css">
<link rel="stylesheet" href="static/common/css/audio.css">
<link rel="stylesheet" href="static/luckysheet/css/pluginsCss.css">
<link rel="stylesheet" href="static/luckysheet/css/plugins.css">
<link rel="stylesheet" href="static/luckysheet/css/luckysheet.css">
<link rel="stylesheet" href="static/luckysheet/css/iconfont.css">
<link rel="stylesheet" href="static/pptxjs/css/pptxjs.css">
<link rel="stylesheet" href="static/pptxjs/css/nv.d3.min.css">

<!-- js -->
<script type="text/javascript" src="static/common/js/jquery-2.0.3.min.js"></script>
<script type="text/javascript" src="static/common/js/jPreview.js"></script>
  1. 初始化
jPreview.preview({
    container:"container", // 容器id
    staticPath:"./static", // 静态资源路径
    url:"", // 预览资源路径,没有的话获取url中scr参数
    ext:"",  // 资源后缀,如果url中没有的话,必须传入后缀名,否则无法识别文件类型
    name:"",  // 资源名称
    watermarkTxt:"文件预览系统", // 水印文字
    watermarkSize:"", // 水印文字大小
    priority:1, // 优先级 1:使用插件预览 2:使用office在线预览,
    oburl:"", // 可自动设置在线设置office线上预览地址,不需要的话可以不传
});
  1. 将静态资源放入到你需要的地方,并在初始化的时候,把相对路径填入staticPath中。

开源库

  1. docx-preview docx文档
  2. pptxjs pptx演示文稿
  3. luckysheet excel表格
  4. sheetjs excel表格,支持xls
  5. superVideo 视频播放器
  6. yAudio 音频播放器
  7. watermark 水印
  8. zoom-marker 图片预览
  9. pdfobject pdf预览

已知bug

pdf文档暂时不支持中文路径

MIT License Copyright (c) 2023 律者 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

一款纯JQ实现的预览插件,支持office文档,图片,音乐,视频,pdf等常用的文件! 展开 收起
JavaScript
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/hanhanjun_admin/j-preview.git
git@gitee.com:hanhanjun_admin/j-preview.git
hanhanjun_admin
j-preview
jPreview
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891