使用pdf.js来打开pdf文件在线预览效果代码
代码语言:html
所属分类:其他
代码描述:使用pdf.js来打开pdf文件在线预览效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>PDF.js Example</title>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/pdf.2.5.js"></script>
</head>
<body>
<input type="file" id="file" accept="application/pdf">
<h2>本地选择一个pdf文件然后看下面的效果:</h2>
<canvas id="pdfCanvas" width="300" height="300"></canvas>
<script>
document.getElementById('file').onchange = function(event) {
.........完整代码请登录后点击上方下载按钮下载查看
网友评论0