手机端 阅读 pdf 文件 touchPDF.js
2017-06-23 15:37
190 查看
touchpdf 中文API
下载地址: http://github.com/loicminghetti/touchpdf/archive/master.zip一款在手机端 阅读pdf 文件的 js库,能够 通过滑动进行 pdf 预览 翻页
TouchPDF是一个jQuery插件,它使用pdf.js短语和呈现支持触摸手势和自动页面选项卡的Web PDF查看器。
依赖关系:
PDF.jsjQuery touchSwipe插件
jQuery panzoom插件
jQuery mousewheel插件
特征:
PDF可以使用滚动,两个手指捏,+/-键和工具栏按钮进行缩放。PDF可以使用一根手指刷。
在文档顶部的工具栏,标题,页码和下一页/上一页和缩放的按钮。
如何使用它:
1.将jQuery TouchPDF的CSS文件加载到文档的头部。
<link href="jquery.touchPDF.css" rel="stylesheet">
2.在文档末尾加载jQuery库,jQuery TouchPDF插件和其他必需的资源。
<script src="pdf.compatibility.js"></script> <script src="pdf.js"></script> <script src="//code.jquery.com/jquery-1.11.2.min.js"></script> <script src="jquery.touchSwipe.min.js"></script> <script src="jquery.touchPDF.js"></script> <script src="jquery.panzoom.js"></script> <script src="jquery.mousewheel.js"></script>
3.为Web PDF查看器创建一个DOM元素。
<div id="myPDF"></div>
4.初始化插件并指定要在DOM元素中显示的PDF文件的路径。
$(function() { $("#myPDF").pdf( { source: "demo.pdf", // MORE SETTINGS HERE } ); });
5.插件参数设置
// Path of PDF file to display source: null, // Title of the PDF to be displayed in the toolbar title: "TouchPDF", // Array of tabs to display on the side. tabs: [], // Default background color for all tabs. // Available colors are "green", "yellow", "orange", "brown", // "blue", "white", "black" and you can define your own colors with CSS. tabsColor: "beige", // Disable zooming of PDF document. disable<a href="http://www.jqueryscript.net/zoom/">Zoom</a>: false, // Disable swipe to next/prev page of PDF document. disableSwipe: false, // Disable all internal and external links on PDF document disableLinks: false, // Disable the arrow keys for next/previous page and +/- for zooming disableKeys: false, // Force resize of PDF viewer on window resize redrawOnWindowResize: true, // Show a toolbar on top of the document with title, // page number and buttons for next/prev pages and zooming showToolbar: true, // A handler triggered when PDF document is loaded loaded: null, // A handler triggered each time a new page is displayed changed: null, // Text or HTML displayed on white page shown before document is loaded loadingHeight: 841, // Height in px of white page shown before document is loaded loadingWidth: 595, // Width in px of white page shown before document is loaded loadingHTML: "Loading PDF"
相关文章推荐
- 关于ipad阅读某些pdf文件出现乱码的简单解决办法
- Java平台要实现类似豆丁百度文科的文档在线阅读,总体思路是讲doc docx等文件格式利用jcom转换成pdf再用swftools转为swf。再用flexpaper组件显示swf。
- html 查看pdf文件 pdf.js
- PDF文件怎么阅读和编辑
- pdf.js – 利用HTML5技术读取PDF文件
- 命令行模式下阅读pdf文件
- .net使用pdfobject.js加载pdf文件
- HTML5在线PDF格式文件阅读器
- 自制适合IPAD阅读的PDF文件
- 用jspdf实现html5页面下载成pdf文件
- Java平台要实现类似豆丁百度文科的文档在线阅读,总体思路是讲doc docx等文件格式利用jcom转换成pdf再用swftools转为swf。再用flexpaper组件显示swf。
- 从Mac上快速将pdf文件转移到iPad/iPhone上阅读
- 文档在线阅读系列之——pdf文件转换为html
- 【Android】Android阅读各种格式文件(包括DOC/DOCX/WPS/XLS/XLSX/PPT/PPTX/TXT/PDF)
- 在你的网页中嵌入PDF等文件,实现pdf在线阅读
- 在你的网页中嵌入PDF等文件,实现pdf在线阅读
- 有了 Aptana 阅读上规模的js文件真是如虎添翼啊,哈哈!
- js插件方式打开pdf文件(浏览器pdf插件分享)
- pdf.js阅读pdf,并统计阅读进度
- Android:使用MuPdf开源库阅读PDF文件