开发者

install pdf reader on page load

开发者 https://www.devze.com 2023-01-24 03:27 出处:网络
If a pdf reader is not installed in the browser ,from a web page how to make a user install pdfreader on开发者_开发百科 the page load with pdf.Can not be done in JavaScript. If the browsers allowed si

If a pdf reader is not installed in the browser ,from a web page how to make a user install pdf reader on开发者_开发百科 the page load with pdf.


Can not be done in JavaScript. If the browsers allowed sites to install pdf viewers, what next? It would be a security nightmare.

You can not, and should not, make your users install anything. Indicate that the file requires a pdf viewer to view the document -- even a few links to free viewers -- and leave it at that.


You can't do this in JavaScript, the browser will prompt the user to download the .pdf file if a reader isn't present (since it doesn't know what else to do with it), but installing any plugin is outside the purview of JavaScript - and should be - it would be a security nightmare.

What would you make them install, Adobe? :)

0

精彩评论

暂无评论...
验证码 换一张
取 消