render-html-to-pdf icon indicating copy to clipboard operation
render-html-to-pdf copied to clipboard

why the pdf backgroundcolor is black?保存的pdf背景居然是黑色

Open JosephBlackWn opened this issue 8 years ago • 3 comments

when I save the html to pdf, the PDF's backgroundcolor is black, but canvas don't draw the black 我保存pdf的时候pdf的背景是黑色的,但是canvas并没有渲染黑色

JosephBlackWn avatar Oct 25 '17 06:10 JosephBlackWn

把你要渲染的那个内容区的背景设置成background:#fff就可以了

SonicAdvan avatar Nov 17 '17 09:11 SonicAdvan

    html2canvas(document.body, {
    	background: '#FFF',
        onrendered:function(canvas) {
            ....
        }
    })

在示例的基础上加 background: '#FFF' ,背景就默认为白色了。

Joezhou123 avatar Oct 10 '18 07:10 Joezhou123

谢谢你哦,虽然这么久才回复,非常感谢哦

--

在 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.

JosephBlackWn avatar Oct 11 '18 01:10 JosephBlackWn