【问题标题】:How to print a page with dynamic content with borders without it breaking?如何打印带有边框的动态内容的页面而不破坏它?
【发布时间】:2019-03-18 13:57:48
【问题描述】:

ol 标签内的内容长度是动态的(由用户输入)。对于这种情况,有没有办法在每页中打印边框?我不能使用 JS,因为我正在处理的当前模块是将纯 html 转换为 pdf。

Currently, the border works for the first page only since I put a static height.

<div style="border: 1px solid #999; margin-top:11px; height:270mm;">
    <table border="0" cellpadding="0" cellspacing="0" style="width:100%; word-break: break-word;">
	<tr>
	    <td colspan="2" style="text-align:left; vertical-align:bottom;height:20px">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</td>
	</tr>
	<tr>
	    <td colspan="2" style="text-align:left; vertical-align:bottom;height:50px; text-align:justify">
	        <ol style="padding-left: 10px; padding-right: 10px; margin-top: 0.5em; margin-bottom: 0.5em;">LONG CONTENT HERE</ol>
	    </td>
        </tr>
    </table>
</div>

【问题讨论】:

    标签: html css pdf printing


    【解决方案1】:

    您可以尝试使用pdf.js。它有很棒的功能。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-03-06
      • 2012-11-11
      • 1970-01-01
      • 1970-01-01
      • 2011-07-07
      • 2018-12-10
      • 2018-04-15
      • 1970-01-01
      相关资源
      最近更新 更多