阅读类网站增加对epub格式的支持
来源:互联网 发布:傲剑丹田升级数据一游 编辑:程序博客网 时间:2024/05/01 03:58
现在的阅读类网站越来越多,如何添加对一个格式的解析和显示呢?
本文以epub格式做一个具体的例子。
1. 安装nodejs环境,详见http://blog.csdn.net/demoshow/article/details/40341363
2. 下载(https://github.com/futurepress/epub.js/) epub.js,解压到epub.js-master。
install the project dependences with npm
npm install
3. 在目录epub.js-master下运行
node server.js
4. 测试结果localhost:8080/reader/dev.html
Getting Started
Get the minified code from the build folder:
<script src="../build/epub.min.js"></script>
If you plan on using compressed (zipped) epubs (any .epub file) include the minified version of zip.js
Also make sure to set EPUBJS.filePath
to the directory containing inflate.js
<!-- Zip JS --><script src="/build/libs/zip.min.js"></script> <script> EPUBJS.filePath = "../build/libs/";</script>
Setup a element to render to:
<div onclick="Book.prevPage();">‹</div><div id="area"></div><div onclick="Book.nextPage();">›</div>
Create the new ePub, and then render it to that element:
<script> var Book = ePub("url/to/book/"); Book.renderTo("area");</script>
0 0
- 阅读类网站增加对epub格式的支持
- epub格式的电子书
- 关于epub格式电子书和PC上的ePub阅读器...
- 孤帆代码着色器1.1.0.0(增加了对rtf格式的支持)
- 我的第一个asp.net webform网站增加对MVC支持的历程
- Linux上不错的EPUB阅读软件
- Linux上不错的EPUB阅读软件
- epub文档转成mobi格式在kindle上阅读
- 增加u-boot对ubi的支持
- 增加u-boot对ubi的支持
- SqlDbx 增加了对PostgreSQL的支持
- Delphi增加对动画Gif的支持
- SourceInsight 增加对Lua语言的支持
- 增加u-boot对ubi的支持
- MyEclipse6.5增加对Tomcat7的支持
- MyEclipse6.5增加对JavaEE6的支持
- android ndk增加对stl的支持
- Android 增加对鼠标的支持
- 2012 九月十月百度人搜,阿里巴巴,腾讯华为笔试面试八十题(第331-410题)
- samba服务器搭建
- Linux重定向console口控制台(Fedora)
- 微型信用支付:网络微型金融的未来
- PL/SQL Developer使用技巧、快捷键
- 阅读类网站增加对epub格式的支持
- mysql 创建用户、设置权限
- hdu 4975 最大流快版
- android 分割线渐变色和几种颜色值定义
- android 图片压缩
- 关于出现在服务器中配置的web,用浏览器打开出现关闭按钮消失或者字体马赛克乱码的问题
- 深入理解Java中的final关键字
- [AC自动机+dp+记录路径] hdu 2825 Ring
- 关于联合体union的详细解释