在不使用Flash的情况下浏览网页中的PDF [英] Browsing PDF in a web page without using Flash
问题描述
我的网页中链接了N页PDF.
I Have an N-Pages PDF linked in a my web page.
我希望能够浏览PDF,以及下一个和上一个箭头,页码等
I want to be able to browse the PDF, with next and prev arrows, page numbers, etc etc
我希望能够在不使用任何Flash插件的情况下浏览PDF.
I want to be able to browse the PDF without using any Flash Plugin.
我也想规范浏览行为,所以我不想使用浏览器的默认PDF插件.
I also want to normalize the browsing behaviour, so i don't want to use the default PDF plugin of the browser.
我正在寻找JS插件,但找不到有趣的解决方案.
I'm looking for a JS plugin but i don't find interesting solutions.
还有其他建议吗?
推荐答案
您可以尝试以下方式:
请参阅下面的代码:
$("a[href*=.pdf]").click(function(){
window.open(this.href);
return false;
});
或者,您可以改为应用target ="_ self"属性:
Alternatively, you can apply the target="_self" attribute instead:
$("a[href*=.pdf]").click(function(){
$(this).attr({"target":"_self"});
return false;
});
如果您需要此处的插件,则为 https://github.com/andreasgal/pdf.js
If you need a plugin here it is https://github.com/andreasgal/pdf.js
插件的演示 http://deanhume.com/content/postimages/pdfjs/pdfjs.htm#1
这篇关于在不使用Flash的情况下浏览网页中的PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!