pdfobject

vue中实现在线预览pdf文件

爱⌒轻易说出口 提交于 2020-08-14 13:55:04
方法1:使用插件pdfObject(Safari不能正常显示,安卓手机的支持也不好) npm i pdfobject -S main.js Vue.prototype.$PDFObject = PDFObject; < div id ="example1" style ="height:600px;width: 80%;margin: 0 auto" ></ div > mounted(){ let _this = this ; this .$nextTick( function (){ _this.$PDFObject.embed( '/pdf/test.pdf', "#example1" ); }); }, 我这里用的是vue3,pdf文件放在public文件夹下 对于兼容问题的解决办法,可以参考: https://www.cnblogs.com/wuhuacong/p/9566764.html 方法2 使用插件vue-pdf npm i vue-pdf -S 在使用的地方: import pdf from 'vue-pdf' 注册组件: components:{pdf}, < ul class ="pdf_pager" > < li @click ="scaleD" > < p > 放大 </ p > </ li > < li @click ="scaleX" > < p >

php使用pdf.js前端输出pdf

夙愿已清 提交于 2020-01-06 21:04:42
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 今天做项目时遇到一个问题 , 需要在页面显示pdf文件 , 并且不能下载和打印 . 这个技术真的没有尝试过 , 所以就开始了我的百度之旅 , 翻看了几篇博客 几乎所有的博客都提到了一个pdfobject.js的框架 , 所以我就去下载了这个框架 网址是https://pdfobject.com/ 点击git后自主下载吧 , 不会玩git的程序员不是好程序员. 将你下载下来的js文件放到你框架里面的js文件夹里 然后引入你要使用的位置 我用的tp5.1 pdfobject.js是不需要经过后台的 直接前端使用就行 我用的是layui 直接用layui.open就好了 然后就可以正常浏览了 对 就是这么简单 如果你想要屏蔽 这两个按钮的话 在模板文件里 加入 style属性就好了 就这么简单 来源: oschina 链接: https://my.oschina.net/u/4196676/blog/3152454

Embed a Blob using PDFObject

帅比萌擦擦* 提交于 2019-12-19 04:41:17
问题 I'm using: https://pdfobject.com/ To display an embedded pdf file on my web app. However I cannot render a pdf created from a blob . This is what I've tried: var arrayBufferView = new Uint8Array(response.Body.data); var file = new Blob([arrayBufferView], { type: response.ContentType }); var url = window.URL.createObjectURL(file) PDFObject.embed(url, "#my-container"); Gets me this result on html: <div id="my-container" class="ng-scope pdfobject-container"> <embed class="pdfobject" src="blob

Display embedded PDF in Internet Explorer 11 from binary string or base64

倖福魔咒の 提交于 2019-12-18 08:47:13
问题 There is a 3rd party service which sends me a PDF file in either binary string or base64 encoded. Is there any possibility to display the PDF embedded in IE 11 using either binary string or base64 encoded. From SO and other forums, I concluded that IE 11 supports data uri only for images and not PDF (I might be wrong) which rules out base64. So the only option left is to display from binary string. I am using it in a Node App but I do not have the option to first save the retrieved file to

Display embedded PDF in Internet Explorer 11 from binary string or base64

社会主义新天地 提交于 2019-12-18 08:47:04
问题 There is a 3rd party service which sends me a PDF file in either binary string or base64 encoded. Is there any possibility to display the PDF embedded in IE 11 using either binary string or base64 encoded. From SO and other forums, I concluded that IE 11 supports data uri only for images and not PDF (I might be wrong) which rules out base64. So the only option left is to display from binary string. I am using it in a Node App but I do not have the option to first save the retrieved file to

Pass value from viewmodel to script in zk

只谈情不闲聊 提交于 2019-12-12 16:49:23
问题 I am trying to use PDFObject to show the pdf files inline. The application may contain many files. All the files are shown in the list. On clicking any one of the file, the pdf should be viewable if browser contains the pdf plugin or else show some anchor tag to download the file. The problem I am having is .. I couldn't figure out how to pass the file name from viewmodel to the script in the zul page. This is what I have done so far.. <?page title="Auto Generated index.zul"?> <?script type=