<!DOCTYPE html>
<!--
Copyright 2012 Mozilla Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Adobe CMap resources are covered by their own copyright but the same license:
Copyright 1990-2015 Adobe Systems Incorporated.
See https://github.com/adobe-type-tools/cmap-resources
-->
<html dir="ltr" mozdisallowselectionprint>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="google" content="notranslate">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>PDF.js viewer</title>
<link rel="stylesheet" href="viewer.css">
<!-- This snippet is used in production (included from viewer.html) -->
<link rel="resource" type="application/l10n" href="locale/locale.properties">
<script src="../build/PDF.JS"></script>
<script type="text/javascript" src="${ctxPath}/static/js/jquery.min.js"></script>
<script type="text/javascript">
//此函数是解析前台传过来的路径,取出pdf图片路径参数
function getArgsFromHref(sArgName) {
// var sHref=window.location.href;
var sHref = location.search;
var args = sHref.split(sArgName + "=");
var retval = "";
//args is null
if (args[0] == sHref) {
return retval;
}
var retval = args[1];
return retval;
}
//实现步骤:ajax到后台生成并保存pdf文件及pdf文件路径等信息在数据库,返回数据库id值——》
//ajax返回后调用pdfjs,并传递文件id,以便通过id获取文件路径从而读取文件流——》
//将得到的文件流在viewer.html展示
var fileid = getArgsFromHref("fileid");//前台传来的文件id
var url_file = fileid;//后台访问路径,通过此后台方法得到文件流
var DEFAULT_URL = "";//默认展示的pdf,注意,删除的变量在这里重新定义
var PDFData = "";//pdf数据流
//这里的ajax就是到后台取pdf文件流
$.ajax({
type: "post",
async: false,
mimeType: 'text/plain;charset=x-user-defined',
url: url_file,
data: {'fileId': fileid},
success: function (data) {
PDFData = data;
}
});
var rawLength = PDFData.length;
//转换成pdf.js能直接解析的Uint8Array类型,见pdf.js-4068
var array = new Uint8Array(new ArrayBuffer(rawLength));
for (i = 0; i < rawLength; i++) {
array[i] = PDFData.charCodeAt(i) & 0xff;
}
DEFAULT_URL = array;
</script>
<script src="viewer.js"></script>
</head>
<body tabindex="1" class="loadingInProgress">
<div id="outerContainer">
<div id="sidebarContainer">
<div id="toolbarSidebar">
<div class="splitToolbarButton toggled">
<button id="viewThumbnail" class="toolbarButton toggled" title="Show Thumbnails" tabindex="2" data-l10n-id="thumbs">
<span data-l10n-id="thumbs_label">Thumbnails</span>
</button>
<button id="viewOutline" class="toolbarButton" title="Show Document Outline (double-click to expand/collapse all items)" tabindex="3" data-l10n-id="document_outline">
<span data-l10n-id="document_outline_label">Document Outline</span>
</button>
<button id="viewAttachments" class="toolbarButton" title="Show Attachments" tabindex="4" data-l10n-id="attachments">
<span data-l10n-id="attachments_label">Attachments</span>
</button>
</div>
</div>
<div id="sidebarContent">
<div id="thumbnailView">
</div>
<div id="outlineView" class="hidden">
</div>
<div id="attachmentsView" class="hidden">
</div>
</div>
<div id="sidebarResizer" class="hidden"></div>
</div> <!-- sidebarContainer -->
<div id="mainContainer">
<div class="findbar hidden doorHanger" id="findbar">
<div id="findbarInputContainer">
<input id="findInput" class="toolbarField" title="Find" placeholder="Find in document…" tabindex="91" data-l10n-id="find_input">
<div class="splitToolbarButton">
<button id="findPrevious" class="toolbarButton findPrevious" title="Find the previous occurrence of the phrase" tabindex="92" data-l10n-id="find_previous">
<span data-l10n-id="find_previous_label">Previous</span>
</button>
<div class="splitToolbarButtonSeparator"></div>
<button id="findNext" class="toolbarButton findNext" title="Find the next occurrence of the phrase" tabindex="93" data-l10n-id="find_next">
<span data-l10n-id="find_next_label">Next</span>
</button>
</div>
</div>
<div id="findbarOptionsOneContainer">
<input type="checkbox" id="findHighlightAll" class="toolbarField" tabindex="94">
<label for="findHighlightAll" class="toolbarLabel" data-l10n-id="find_highlight">Highlight all</label>
<input type="checkbox" id="findMatchCase" class="toolbarField" tabindex="95">
<label for="findMatchCase" class="toolbarLabel" data-l10n-id="find_match_case_label">Match case</label>
</div>
<div id="findbarOptionsTwoContainer">
<input type="checkbox" id="findEntireWord" class="toolbarField" tabindex="96">
<label for="findEntireWord" class="toolbarLabel" data-l10n-id="find_entire_word_label">Whole words</label>
<span id="findResultsCount" class="toolbarLabel hidden"></span>
</div>
<div id="findbarMessageContainer">
<span id="findMsg" class="toolbarLabel"></span>
</div>
</div> <!-- findbar -->
<div id="secondaryToolbar" class="secondaryToolbar hidden doorHangerRight">
<div id="secondaryToolbarButtonContainer">
<button id="secondaryPresentationMode" class="secondaryToolbarButton presentationMode visibleLargeView" title="Switch to Presentation Mode" tabindex="51" data-l10n-id="presentation_mode">
<span data-l10n-id="presentation_mode_label">Presentation Mode</span>
</button>
<button id="secondaryOpenFile" class="secondaryToolbarButton openFile visibleLargeView" title="Open File" tabindex="52" data-l10n-id="open_file">
<span data-l10n-id="open_file_label">Open</span>
</button>
<button id="secondaryPrint" class="secondaryToolbarButton print visibleMediumView" title="Print" tabindex="53" data-l10n-id="print">
<span data-l10n-id="print_label">Print</span>
</button>
<button id="secondaryDownload" class="secondaryToolbarButton download visibleMediumView" title="Download" tabindex="54" data-l10n-id="download">
<span data-l10n-id="download_label">Download</span>
</button>
<a href="#" id="secondaryViewBookmark" class="secondaryToolbarButton bookmark visibleSmallView" title="Current view (copy or open in new window)" tabindex="55" data-l10n-id="bookmark">
<span data-l10n-id="bookmark_label">Current View</span>
</a>
<div class="horizontalToolbarSeparator visibleLargeView"></div>
<button id="firstPage" class="secondaryToolbarButton firstPage" title="Go to First Page" tabindex="56" data-l10n-id="first_p
没有合适的资源?快使用搜索试试~ 我知道了~
pdfjs-2.2.228-dist.zip
共400个文件
bcmap:168个
properties:124个
png:86个
需积分: 46 36 下载量 201 浏览量
2020-03-25
22:45:47
上传
评论
收藏 3.17MB ZIP 举报
温馨提示
使用pdfjs-2.2.228-dist实现pdf文件在线预览,客户端无需下载任何插件即可在线预览pdf文件
资源推荐
资源详情
资源评论
收起资源包目录
pdfjs-2.2.228-dist.zip (400个子文件)
UniCNS-UTF8-H.bcmap 52KB
UniCNS-UTF32-H.bcmap 51KB
UniCNS-UTF16-H.bcmap 49KB
UniCNS-UCS2-H.bcmap 47KB
UniGB-UTF8-H.bcmap 46KB
UniGB-UTF32-H.bcmap 45KB
UniGB-UTF16-H.bcmap 43KB
UniGB-UCS2-H.bcmap 42KB
UniJIS2004-UTF8-H.bcmap 41KB
UniJIS-UTF8-H.bcmap 41KB
Adobe-CNS1-UCS2.bcmap 40KB
Adobe-Japan1-UCS2.bcmap 40KB
UniJIS2004-UTF32-H.bcmap 40KB
UniJISX02132004-UTF32-H.bcmap 40KB
UniJIS-UTF32-H.bcmap 40KB
UniJISX0213-UTF32-H.bcmap 40KB
UniJIS2004-UTF16-H.bcmap 39KB
UniJIS-UTF16-H.bcmap 39KB
Adobe-GB1-UCS2.bcmap 33KB
UniKS-UTF8-H.bcmap 27KB
UniKS-UTF32-H.bcmap 26KB
UniKS-UTF16-H.bcmap 26KB
UniKS-UCS2-H.bcmap 25KB
UniJIS-UCS2-H.bcmap 25KB
Adobe-Korea1-UCS2.bcmap 23KB
GBK2K-H.bcmap 19KB
KSC-Johab-H.bcmap 16KB
GBK-EUC-H.bcmap 14KB
GBKp-EUC-H.bcmap 14KB
GBTpc-EUC-H.bcmap 7KB
GBT-EUC-H.bcmap 7KB
GBT-H.bcmap 7KB
HKscs-B5-H.bcmap 4KB
ETHK-B5-H.bcmap 4KB
KSCms-UHC-HW-H.bcmap 3KB
KSCms-UHC-H.bcmap 3KB
NWP-H.bcmap 3KB
HKdla-B5-H.bcmap 3KB
78ms-RKSJ-H.bcmap 3KB
Ext-RKSJ-H.bcmap 2KB
Ext-H.bcmap 2KB
Add-H.bcmap 2KB
HKdlb-B5-H.bcmap 2KB
Add-RKSJ-H.bcmap 2KB
78-EUC-H.bcmap 2KB
78-RKSJ-H.bcmap 2KB
78-H.bcmap 2KB
HKgccs-B5-H.bcmap 2KB
HKm471-B5-H.bcmap 2KB
KSCpc-EUC-H.bcmap 2KB
CNS-EUC-V.bcmap 2KB
KSC-EUC-H.bcmap 2KB
KSC-H.bcmap 2KB
CNS-EUC-H.bcmap 2KB
HKm314-B5-H.bcmap 2KB
ETen-B5-H.bcmap 1KB
B5pc-H.bcmap 1KB
B5-H.bcmap 1KB
90pv-RKSJ-H.bcmap 982B
83pv-RKSJ-H.bcmap 905B
UniJISPro-UTF8-V.bcmap 726B
90ms-RKSJ-H.bcmap 721B
90msp-RKSJ-H.bcmap 715B
CNS1-H.bcmap 706B
UniJISPro-UCS2-HW-V.bcmap 705B
UniJISPro-UCS2-V.bcmap 689B
UniJISX02132004-UTF32-V.bcmap 688B
UniJISX0213-UTF32-V.bcmap 684B
UniJIS2004-UTF8-V.bcmap 682B
UniJIS2004-UTF32-V.bcmap 681B
UniJIS-UCS2-HW-V.bcmap 680B
UniJIS-UTF8-V.bcmap 678B
UniJIS-UTF32-V.bcmap 677B
UniJIS-UCS2-V.bcmap 664B
UniJIS2004-UTF16-V.bcmap 647B
UniJIS-UTF16-V.bcmap 643B
Adobe-GB1-5.bcmap 625B
Adobe-GB1-4.bcmap 601B
EUC-H.bcmap 578B
GBpc-EUC-H.bcmap 557B
H.bcmap 553B
GB-EUC-H.bcmap 549B
RKSJ-H.bcmap 534B
GB-H.bcmap 528B
CNS2-H.bcmap 504B
Adobe-Japan1-6.bcmap 485B
Adobe-GB1-3.bcmap 470B
Adobe-GB1-2.bcmap 465B
Adobe-Japan1-5.bcmap 430B
Adobe-CNS1-6.bcmap 406B
Adobe-CNS1-5.bcmap 406B
Adobe-CNS1-4.bcmap 405B
Adobe-CNS1-3.bcmap 401B
Adobe-Korea1-2.bcmap 391B
Adobe-Korea1-1.bcmap 386B
Adobe-CNS1-2.bcmap 376B
Adobe-CNS1-1.bcmap 371B
Adobe-Japan1-4.bcmap 337B
Adobe-CNS1-0.bcmap 317B
90msp-RKSJ-V.bcmap 291B
共 400 条
- 1
- 2
- 3
- 4
资源评论
人禺是页
- 粉丝: 5
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功