日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

手机端 阅读 pdf 文件 touchPDF.js

發(fā)布時間:2023/12/29 编程问答 39 豆豆
生活随笔 收集整理的這篇文章主要介紹了 手机端 阅读 pdf 文件 touchPDF.js 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

touchpdf 中文API

下載地址: http://github.com/loicminghetti/touchpdf/archive/master.zip

一款在手機端 閱讀pdf 文件的 js庫,能夠 通過滑動進行 pdf 預覽 翻頁
TouchPDF是一個jQuery插件,它使用pdf.js短語和呈現(xiàn)支持觸摸手勢和自動頁面選項卡的Web PDF查看器。

依賴關系:

  • PDF.js
  • jQuery 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查看器創(chuàng)建一個DOM元素。

<div id="myPDF"></div>

4.初始化插件并指定要在DOM元素中顯示的PDF文件的路徑。

$(function() {$("#myPDF").pdf( {source: "demo.pdf",// MORE SETTINGS HERE} ); });

5.插件參數(shù)設置

// 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"

總結

以上是生活随笔為你收集整理的手机端 阅读 pdf 文件 touchPDF.js的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內容還不錯,歡迎將生活随笔推薦給好友。