我面临着phantomjs的问题(html到pdf),我有1个html页面有16个div我愿意在每个上面添加分页符,但是当我添加page-break-after时:总是在每个div然后在pdf中创建大量的空格,假设当我在2 div上添加空间并且休息时没有页面中断然后空格有点但是当添加空格3,4,5等空间添加更多意味着每个页面有很多空格,如何我可以提前解决这个问题.
这是我的代码
fs.readFile(__dirname + '/../pdf' + pdfpath, 'utf8', function (err, data) {
// Render the page to variable.
var html = ejs.render(data, pdfJSON);
// Set this html as the content for the pdf file.
page.set('content', html);
var fileName = __dirname + '/pdfdata/' + f.formType + f.formId + '.pdf';
// Generate the pdf.
page.render(fileName);
});
Run Code Online (Sandbox Code Playgroud)
这是我的HTML页面代码
<html>
<head>
<title>PreQual PDF Export</title>
<style type="text/css">
<!--
body { font-family: Arial; font-size: 33.0px }
.pos { position: absolute; z-index: 0; left: 0px; top: …Run Code Online (Sandbox Code Playgroud)