千古文章一大抄,抄又抄不全,气死了!
解决办法:
1.首选在预览的pdf上面添加一个id,外面包裹一层div添加一个id也行,很关键的!
2.添加样式,关键的是给id加上样式,好多都没抄对!!
<style>
@media print {
@page {
size: auto; /* auto is the initial value */
margin: 3mm; /* this affects the margin in the printer settings */
}
html {
background-color: #ffffff;
margin: 0px; /* this affects the margin on the html before sending to printer */
}
body {
border: solid 1px rgba(255, 255, 255, 0);
margin: 10mm 15mm 10mm 15mm;
/* margin you want for the content */
height:auto;
}
#pdfPrint {
margin: 0 1em;
}
}