html2pdf 在下载的文件中生成损坏的部分
html2pdf generates corrupted parts in the downloaded file
我在我的代码中使用了 html2pdf 来启用将 html 文件转换为 pdf 文件然后下载它们。
在我的 html 文件中,我有一些使用 amChart 编码的统计图形。
问题是我有一个完美的文件,但有损坏的部分。包含 amChart graphics.Here 的部分是 html 页面中的图表:
这是我在下载的 pdf 文件中得到的
我使用此代码启用下载(使用 angular 我刚刚使用 bower 安装了必要的依赖项)。
你好某人
<div pdf-save-content="idOne" >
Hello Someone
</div>
有人可以帮我解决这个问题吗?
我知道 amchart 提供了一个库来下载不同形式的图表(csv、png、pdf、..)这不是必需的,我需要下载整个页面。
这也不是宽度问题。
为了解决这个问题,我使用了这个 amCharts demo。使用 pdfMake 比使用 html2pdf
更好
chart["export"].toPDF(layout, function(data) {
this.download(data, "application/pdf", "amCharts.pdf");
});
我在我的代码中使用了 html2pdf 来启用将 html 文件转换为 pdf 文件然后下载它们。
在我的 html 文件中,我有一些使用 amChart 编码的统计图形。
问题是我有一个完美的文件,但有损坏的部分。包含 amChart graphics.Here 的部分是 html 页面中的图表:
<div pdf-save-content="idOne" >
Hello Someone
</div>
有人可以帮我解决这个问题吗? 我知道 amchart 提供了一个库来下载不同形式的图表(csv、png、pdf、..)这不是必需的,我需要下载整个页面。 这也不是宽度问题。
为了解决这个问题,我使用了这个 amCharts demo。使用 pdfMake 比使用 html2pdf
更好chart["export"].toPDF(layout, function(data) {
this.download(data, "application/pdf", "amCharts.pdf");
});