I am using print.js library to print the pdf.
(我正在使用print.js库来打印pdf。)
I want an image to be appearing on header of every pdf page.(我希望图像出现在每个pdf页面的标题上。)
I am using header attribute like this: printJs({printable: 'printJS-form', type: 'html', header: '<img src = 'intro.js'/>)
but it only prints text and not the image.(我正在使用这样的标头属性: printJs({printable: 'printJS-form', type: 'html', header: '<img src = 'intro.js'/>)
但它仅显示文本,而不显示图像。)
As well as i want an image in the as a footer of each pdf page.
(以及我想要的图像作为每个pdf页面的页脚。)
How to acheive both using printjs.(如何使用printjs实现两者。)
I am not using any framework jsut plain html,css and js(我没有使用任何框架jsut纯html,css和js)
Below is my html file
(以下是我的html文件)
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href=" https://printjs-4de6.kxcdn.com/print.min.css">
<link rel="stylesheet" href="style.css">
<script src="https://printjs-4de6.kxcdn.com/print.min.js"></script>
</head>
<body>
<form method="post" action="#" id="printJS-form">
<h1 class="display">
VALUATION FORM
</h1>
<div>
<div>
<div>
<label for="refValueInput" class="control-label">Client</label>
<input id="refValueInput" required="" class="form-control" placeholder="Enter Client Name." maxlength="255" type="text" tabindex="2">
</div>
</div>
<div class="display">
<p style="margin-left:135px;">1. Purpose for which valuation is made :</p>
<span>To Find out the value of the property for the financial</span>
<p id="mar">Institution for the Loan Purpose.</p>
</div>
</form>
<button type="button" onclick="printJS({ printable: 'printJS-form', type: 'html', header: '<header><img src = 'intro.jpg'/></header>'})">
Print Form with Header
</button>
</body>
</html>
ask by SAMAR translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…