Web项目中预览PDF
来源:互联网 发布:网吧网络是多少兆宽带 编辑:程序博客网 时间:2024/04/30 09:49
介绍
Js版本
<html><head><script type="text/javascript" src="http://mozilla.github.io/pdf.js/build/pdf.js"></script></head><body><canvas id="the-canvas" style="border:1px solid black" height="300" width="300"></canvas><script type="text/javascript">PDFJS.getDocument("http://mozilla.github.io/pdf.js/web/compressed.tracemonkey-pldi-09.pdf").then(function getPdfHelloWorld(pdf) {/* * 获取第一页 */pdf.getPage(1).then(function getPageHelloWorld(page) {var scale = 1.5;var viewport = page.getViewport(scale);//准备画布var canvas = document.getElementById('the-canvas');var context = canvas.getContext('2d');canvas.height = viewport.height;canvas.width = viewport.width;//pdf文档渲染var renderContext = {canvasContext : context,viewport : viewport};page.render(renderContext);});});</script></body></html>[/codesyntax]
Java
查看原文:http://surenpi.com/2017/01/09/web_view_pdf/
0 0
- Web项目中预览PDF
- Openerp Web PDF Report Preview & Print 浏览器中预览打印
- java web在线预览pdf
- 网页中预览PDF文件
- Android中使用MuPDF预览pdf文档
- pdf 预览
- web项目jquery实现本地图片预览
- 【教程】PDF组件Spire.PDF 教程:在C#中显示PDF文件的打印预览
- 使用pdf.js+jacob实现web版的pdf文件预览
- Web中显示pdf文件
- web中显示pdf文件
- TeXnicCenter中使用DDE实现关闭pdf预览后编译
- 浏览器中在线预览pdf文件(不使用插件)
- pdf.js预览pdf文件
- PDF文件预览控件
- pdf 文档 在线预览
- PDF在线预览下载
- pdf在线预览
- css分割线
- 数据挖掘十大经典算法
- 初尝phpunit进行接口自动化测试
- class template
- 【Android 基础】GridView中使用ImageLoader
- Web项目中预览PDF
- 第5课 Python函数库分类及函数标准库示例
- 通过Time、Window与Trigger比较Google Cloud DataFlow与Apache Flink的区别
- 开发:web.py(上)
- MipMap与LOD是何物?
- iOS 图片被渲染的解决方法
- IDEA配置Struts2出现There is no Action mapped for namespace [/] and action name [login]
- GitHub Android Libraries Top 100 简介
- 窗体居中,获得焦点