Display
一、PDF.js 基础知识
https://github.com/mozilla/pdf.js
二、Rendering PDF Files in the Browser with PDF.js
One of the most popular solutions for rendering PDF files in the browser: PDF.js.
三、案例列表
解决手机端,用微信浏览器中预览pdf文件,并实现手势放大缩小
然后下载 swipe.js 和 pinchzoom.js 扔到页面上
[非常好] Swipe-移动触摸滑动轮播图插件swipe.js
原文链接:http://caibaojian.com/swipe.html
原文链接:swipe.js 轻松实现手机端滑动效果
设置选项
-
- startSlide Integer (default:0) - 开始滚动的位置
- speed Integer (default:300) - 动画滚动的间隔(秒数)
- auto Integer - 开始自动幻灯片(以毫秒为单位幻灯片之间的时间)
- continuous Boolean (default:true) - 创建一个无限的循环(当滑动到所有动画结束时是否循环滑动)
- disableScroll Boolean (default:false) - 当滚动滚动条时是否停止幻灯片滚动
- stopPropagation Boolean (default:false) - 是否停止事件冒泡
- callback Function - 幻灯片运行中的回调函数
- transitionEnd Function - 动画运行结束的回调函数
代码展示:loicminghetti/touchpdf
demo: http://touchpdf.net/demo/index.htm [适用不错]
This plugin heavily relies on the following great open source work:
-
- PDF.js by Mozilla https://mozilla.github.io/pdf.js/
- PanZoom jQuery plugin by Timmy Willison https://github.com/timmywil/jquery.panzoom
- TouchSwipe jQuery plugin by Matt Bryson https://github.com/mattbryson/TouchSwipe-Jquery-Plugin
四、其他资源
/* implement */
手势控制
一、anytouch
https://any86.github.io/any-touch/#/
二、swipe.js
插件下载地址
官网:http://www.swipejs.com
github:https://github.com/bradbirdsall/Swipe
插件特色
swipe.js是一个比较有名的触摸滑动插件,它能够处理内容滑动,支持自定义选项,你可以让它自动滚动,控制滚动间隔,返回回调函数等。经常可见使用在移动开发中
三、touch.js
原文链接:https://blog.csdn.net/niedewang/java/article/details/80391612
经过测试,使用pdf.js这个开源库,自己编写代码实现pdf 文件浏览也不是很复杂。参照我以前的blog文章,如果要实现上一页,下一页,旋转等都非常简单。
但是,手机端是个比较依赖手势特殊存在。如果要实现如下功能:
1:双指放大,通过捏合双指进行放大或缩小
2:单个手指移动,放大后,通过单指移动,定位到pdf指定的区域
3:左右滑动分页,比如左滑上一页,右滑下一页。
如果要实现如上功能,自己编写的话,还真不容易。
但有一个现成的开源插件–touch.js .已经实现上述的所有功能,并且还具有章节导航等其他附加功能。
touch.js 是I整合了pdf.js,PanZoom TouchSwipe
等多个开源系统,实现了专用于手机端浏览的系统。简单的说,你想用最小的代码,想在手机端简单的浏览pdf的话,那么touch,js
是您的最佳选择
四、付费的方案
End.