render-html-to-pdf
render-html-to-pdf copied to clipboard
why the pdf backgroundcolor is black?保存的pdf背景居然是黑色
when I save the html to pdf, the PDF's backgroundcolor is black, but canvas don't draw the black 我保存pdf的时候pdf的背景是黑色的,但是canvas并没有渲染黑色
把你要渲染的那个内容区的背景设置成background:#fff就可以了
html2canvas(document.body, {
background: '#FFF',
onrendered:function(canvas) {
....
}
})
在示例的基础上加 background: '#FFF' ,背景就默认为白色了。
谢谢你哦,虽然这么久才回复,非常感谢哦
--
在 2018-10-10 15:53:08,"Joezhou123" [email protected] 写道:
html2canvas(document.body, {
background: '#FFF',
onrendered:function(canvas) {
....
}
})
在示例的基础上加 background: '#FFF' ,背景就默认为白色了。
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.