【发布时间】:2015-11-18 13:51:48
【问题描述】:
我想使用在线工具或 html2pdf 库将 html 文件转换为 pdf 格式。但它会转换所有页面,但不会转换背景图像。
<STYLE type="text/css">
body {margin-top: 0px;margin-left: 0px;
background-image: url(http://162.250.122.195/check/0Certificate_of_Attendance_Form_UNDERLINE_images/0Certificate_of_Attendance_Form_UNDERLINE1x1.jpg);
}
</style>
<html>
<body>
<div>
<h1>Hello world!</h1>
<p><a href="http://www.w3schools.com">Visit W3Schools.com!</a></p>
</div>
</body>
</html>
【问题讨论】:
-
那是因为你的图片在不同的域中。
-
如果确定就回答
-
假设错误。