html导出pdf ie9报错,jsPDF插件没有工作到ie9(jsPDF plugin not working upto ie9)

博客讨论了使用jsPDF插件在IE9及以下版本浏览器中转换HTML为PDF时遇到的兼容性问题。尽管jsPDF本身是HTML5解决方案,但在旧版IE中可能不工作。解决方案可能包括寻找启用IE6-9垫片的版本或者寻找替代方案。文章提到了html2canvas作为替代方法,并提供了示例代码。同时,还建议检查浏览器设置,如启用Cookie,以确保问题不在于其他配置。
摘要由CSDN通过智能技术生成

jsPDF插件没有工作到ie9(jsPDF plugin not working upto ie9)

我正在使用jsPDF插件将html页面转换为pdf文件。 除了某些版本的IE 之外,它在所有浏览器中都运行良好。

直到IE 10,它不起作用,在IE11中它正在工作。 是否可以使其与IE9和IE10兼容?

I'm using the jsPDF plugin to convert a html page into a pdf file. It's working fine in all the browsers except some versions of IE.

Up to IE 10, it's not working and in IE11 it's working. Is it possible to make it compatible with IE9 and IE10?

原文:https://stackoverflow.com/questions/31921838

更新时间:2020-01-29 13:28

最满意答案

jsPDF是一个html5解决方案,它们的页面统计数据是ie9及以下版本有一个懒惰的闪存垫片但是“当前版本没有启用IE6-9垫片”所以你只需要获得一个启用它的版本

jsPDF is a html5 solution, their page stats that there is a lazy flash shim for ie9 and below but "Current build does not have IE6-9 shim enabled" so you will just need to get a version that does have it enabled

相关问答

是的,但不是你会想象的。 根据caniuse (一个非常好的资源),没有任何支持,没有可以为IE9添加text-shadow支持的polyfill。 但是, IE有自己的专有文字阴影( 详见这里 )。 示例实现,从他们的网站(在IE5.5到IE9中的工作): p.shadow {

filter: progid:DXImageTransform.Microsoft.Shadow(color=#0000FF,direction=45);

}

为了跨浏览器的兼容性和代码的未来考虑,请记住还要

...

jsPDF的html插件不支持大多数CSS。 但绝望不是,这是一个解决方案。 试试看: $( 'a' ).hide();

html2canvas( document.body, { onrendered : function( canvas ) { 'use strict';

var pdf = new jsPDF(), border = 10, width = 210-border*2;

pdf.addImage( canvas.toDataURL( 'image/jpeg' ,

...

你可以随时使用:

Create Node test

window.onload = function () {

var head = document.getElementsByTagName('head')[0];

var styleEl = document.createElemen

...

jsPDF是一个html5解决方案,它们的页面统计数据是ie9及以下版本有一个懒惰的闪存垫片但是“当前版本没有启用IE6-9垫片”所以你只需要获得一个启用它的版本 jsPDF is a html5 solution, their page stats that there is a lazy flash shim for ie9 and below but "Current build does not have IE6-9 shim enabled" so you will just need

...

无法重现。 对我来说效果很好。 您的设置必定存在其他问题。 您是否验证了Cookie是否已启用? Unable to reproduce. Works perfectly fine for me. There must be some other problem with your setup. Did you verify if cookies were enabled?

IE9或更低版本不支持动画,转换和转换。 IE 10+支持它们,但即使在这种情况下,用户在使用IE时也会遇到很多问题。 最好的办法是使用javascript。 使用javascript,你可以避免CSS3 animations ,甚至在IE中运行你的结果更好。 有关animations, transitions and transformations浏览器兼容性animations, transitions and transformations查看以下链接: https : //develope

...

IE9的行为是正确的,较低版本是错误的。 这个问题是由两个html标签之间的空白引起的,这些标签应该导致文本节点。 更新:添加了示例

  • Foo
  • Bar
  • Foo
  • Bar

看起来几乎一样,不是吗? 然而,由此产生的DOM不同。 第一个例子会导致: - ul

-- li

--- (text)Foo

-- li

---(text)Bar

虽然第二个Markup导致了这个: -

...

似乎实现这一目标的唯一方法是摆弄注册表。 这个.reg文件适用于我自己的搜索插件: Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchScopes\{5AB8F1FE-2CAD-45FD-8B50-9E5610E4D2B6}]

"DisplayName"="Mysite search"

"URL"="http://mysite/index.jsp?q

...

找到解决方案,更改标题中的IE模式(关闭quirk模式):

它适用于IE8和IE9。 Found a solution, change the IE mode in the header (switch off quirk mode) :

It's working for IE

...

来自Joomla的Mark Dexter! CMS Development说: 这是我们在如此长时间内尝试支持1.5版本时遇到的问题的完美示例。 一方面,我们希望与当前版本的3p软件保持同步。 另一方面,我们希望保持向后兼容性。 在这么长的时间内(> 3年),这两个目标即使不是不可能也会变得困难。 标记 作为一种解决方法,您可以使用JCE,它使用更新版本的TinyMCE及其基于它。 http://extensions.joomla.org/extensions/edition/editors/88

...

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值