pdf预览下载pdf.js
pdf.js
PDF Reader in JavaScript
项目地址:https://gitcode.com/gh_mirrors/pd/pdf.js
免费下载资源
·
下载pdf.js
官网地址
https://mozilla.github.io/pdf.js/
php代码
//转义两次php把中文字转义
$title =iconv("utf-8","gbk",urlencode(urlencode($info['pdf_name'])));
$url=request()->domain();
$code_content = $url.'/static/pdf/web/viewer.html?file=/static/uploads/'.$info['pdf'].'&dow='.$url.'/static/uploads/'.$info['spdf'].'&title='.$title;
js
//接受url的参数
function GetRequest() {
var url = location.search; //获取url中"?"符后的字串
var theRequest = new Object();
if (url.indexOf("?") != -1) {
var str = url.substr(1);
var strs = str.split("&");
for(var i = 0; i < strs.length; i ++) {
theRequest[strs[i].split("=")[0]]=unescape(strs[i].split("=")[1]);
}
}
return theRequest;
}
//在viewer.js中function download方法
//转义传过来的下载名
var filename = decodeURIComponent(arr.tit);
GitHub 加速计划 / pd / pdf.js
47.48 K
9.86 K
下载
PDF Reader in JavaScript
最近提交(Master分支:2 个月前 )
18284815
[Editor] Update the disclaimer string in the new alt-text dialog (bug 1911738) 2 个月前
fc602c65
And tweak the css in order to take into account that disclaimer can be on two (or more lines).
2 个月前
更多推荐
已为社区贡献1条内容
所有评论(0)