Jspdf没有在边缘浏览器上渲染高图图像 [英] Jspdf not rendering highcharts image on edge browser
问题描述
我是jsPDF的新手,我正在尝试使用一些html内容下载 highchart
。我的代码适用于除Microsoft Edge 20.0以上版本之外的所有浏览器。
我尝试过:
这是工作中的 Plunker 。我搜索过类似的问题,但没有人谈论边缘浏览器,另外,我尝试使用png图像而不是像这个但没有运气。
注意:我已经尝试将图片网址直接传递给.addImage()函数,该函数适用于所有浏览器。
有人可以指点我,我错过了什么或做错了吗?
我找到了一个问题。代码无法在IE 11上运行。现在它正在运行。但我看到边缘的另一个错误。我认为您需要报告插件网站上的错误。这里 - 问题·MrRio / jsPDF·GitHub [ ^ ]
'RGBColor'未定义
如果你检查canvg.js文件,就会写一行。
*需要:rgbcolor.js - http: // www.phpied.com/rgb-color-parser-in-javascript /所以,包括js文件 http://www.phpied.com/files/rgbcolor/rgbcolor.js [ ^ ]并享受。
感谢您查看此问题@Tadit。我得到了解决这个问题的方法。
我想这个问题与Edge-Canvas问题有关。
而不是SVG- > Canvas,我用SVG-> Blob-> Image-> Canvas
方法。
这是更新后的Plunkr 。
I am new to jsPDF and I am trying to download the highchart
with some html content. My code works fine for all browser except "Above Microsoft Edge 20.0 versions".
What I have tried:
Here is the working Plunker. I have googled similar questions but none of them talk about edge browser, additionally, I have tried using png image instead of JPEG like this but no luck.
Note: I have tried passing directly image url to .addImage() function which works fine with all browser.
Can someone please point me, what I am missing or doing wrong?
I found one issue. Code was not working on IE 11. Now it is working. But I see another error in edge. I think you need to report a bug on plugin site. Here - Issues · MrRio/jsPDF · GitHub[^]
'RGBColor' is undefined
And if you check the canvg.js file, there is a line written.
* Requires: rgbcolor.js - http://www.phpied.com/rgb-color-parser-in-javascript/So, include the js file http://www.phpied.com/files/rgbcolor/rgbcolor.js[^] and enjoy.
Thanks for looking into this issue @Tadit. I got the workaround for this problem.
The problem is related to an Edge-Canvas issue, I suppose.
Instead of SVG->Canvas, I usedSVG->Blob->Image->Canvas
approach.
Here is the updated Plunkr.
这篇关于Jspdf没有在边缘浏览器上渲染高图图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!