【发布时间】:2016-09-07 15:33:13
【问题描述】:
我正在使用 jsPDF 1.2.60 和 jsPDF AutoTable 2.0.32 插件来生成一个 PDF,其中包含一个包含 colspans 和 rowspans 以及图像(数据 URI)的表格。它在 Chrome 和 Firefox 中运行没有问题,但我无法使其在 IE10 和 IE11 中运行。
我尝试使用 jsPDF 1.0.272,因为我读到它应该在 IE
我包含以下脚本:
<script type="text/javascript" src="/Scripts/jsPDF-1.2.60/examples/js/jquery/jquery-ui-1.8.17.custom.min.js"></script>
<script type="text/javascript" src="/Scripts/jsPDF-1.2.60/dist/jspdf.min.js"></script>
<script type="text/javascript" src="/Scripts/jsPDF-1.2.60/plugins/split_text_to_size.js"></script>
<script type="text/javascript" src="/Scripts/jsPDF-1.2.60/plugins/standard_fonts_metrics.js"></script>
<script type="text/javascript" src="/Scripts/jsPDF-1.2.60/libs/css_colors.js"></script>
<script type="text/javascript" src="/Scripts/jsPDF-1.2.60/libs/deflate.js"></script>
<script type="text/javascript" src="/Scripts/jsPDF-1.2.60/libs/html2pdf.js"></script>
<script type="text/javascript" src="/Scripts/jsPDF-1.2.60/libs/polyfill.js"></script>
<script type="text/javascript" src="/Scripts/jsPDF-AutoTable-2.0.32/dist/jspdf.plugin.autotable.js"></script>
<script type="text/javascript" src="/Scripts/jquery.tableparser-master/jquery.tableparser-min.js"></script>
有人在 IE 中成功使用过这个库吗?
谢谢, 米哈埃拉
【问题讨论】:
-
您可以尝试删除所有脚本并只保留
/Scripts/jsPDF-1.2.60/dist/jspdf.min.js,看看您是否遇到同样的问题?顺便说一句,除非您知道自己在做什么,否则您永远不应该包含/Scripts/jsPDF-1.2.60/libs/*,因为 dist 文件默认包含所有这些。 -
@SimonBengtsson,终于成功了,但并非适用于所有情况,请在下面查看我的答案。您是否有解决该错误的建议。如果需要,我可以提供有效的代码,但不能提供无效的代码:)。谢谢
-
例如,它似乎根本不受支持。关注问题的Github:github.com/simonbengtsson/jsPDF-AutoTable/issues/38也许还有其他解决方案...
标签: internet-explorer html-table jspdf jspdf-autotable