【发布时间】:2018-07-06 07:09:13
【问题描述】:
我正在尝试使用 wkhtmltopdf 将 HTML 转换为 PDF 文档。
我正在运行的命令是wkhtmltopdf ./test.html test.pdf
软件版本:
wkhtmltopdf -V
wkhtmltopdf 0.12.5 (with patched qt)
内容是动态的,因此我真的不知道它会在哪里结束。
不幸的是,当内容呈现到第二页时,背景随着内容停止。
下面的 HTML,任何帮助都将不胜感激,并使老开发人员在经历了这么多的努力后感到高兴:)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<head>
<title>Testing PDF</title>
<link href="https://fonts.googleapis.com/css?family=Lato:400,700" rel="stylesheet">
<style>
html {
height: 100%;
background: #f3f8fb;
}
body {
font-family: "Lato", sans-serif;
color: black;
background: #f3f8fb;
}
</style>
</head>
<body>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
<p>This is a test with lots of dynamic content</p>
</body>
</html>
【问题讨论】:
标签: pdf-generation wkhtmltopdf