如何删除 PDF 中网络表单的标题和提交编号?
我正在使用 twig 在 PDF 附件< 中显示表单提交的所有数据/a> 字段。编写 twig 代码后,
表单的标题和提交 ID 不会消失并弄乱模板,而且我什至没有将它们放在 twig 上。
尽管我的代码在编辑器中运行良好,但日期和 p 标记未正确打印
谁能告诉我为什么以及如何解决该问题?
<style>
.wrap {
text-align: center;
}
#signature {
display: inline-table;
border-collapse: collapse;
table-layout: auto;
border: 1px solid rgba(5, 138, 222, 0.67);
empty-cells: show;
margin: 1%;
table-layout: auto;
}
#sign {
border: 1px solid rgba(5, 138, 222, 0.67);
padding: 10px;
}
th {
background-color: rgba(143, 220, 242, 0.67);
border: 1px solid rgba(5, 138, 222, 0.67);
border-left: 1px solid rgba(5, 138, 222, 0.67);
border-bottom: 1px solid rgba(5, 138, 222, 0.67);
color: #000000;
text-align: center;
font-weight: bold;
vertical-align: middle;
padding: .75em .5em;
}
td {
text-align: right;
border: 1px solid rgba(5, 138, 222, 0.67);
vertical-align: middle;
padding: .75em .5em;
}
#item {
border-collapse: collapse;
border: 1px solid rgba(5, 138, 222, 0.67);
empty-cells: show;
margin: 1%;
table-layout: auto;
width: 100%;
}
p {
font-weight: bold;
}
</style>
<body>
<h1 style="float: right;">Date: <u>[webform_submission:values:date_]</u></h1>
<table id="item">
<tr>
<th colspan="5">Expense Item</th>
</tr>
<tr>
<th>Service Purchased</th>
<th>Purpose</th>
<th>Receipt</th>
<th>Account Code</th>
<th>Amount</th>
</tr>
{% for item in data.voucher %}
<tr>
<td>{{item.date}}</td>
<td>{{item.purpose}}</td>
<td><input type="checkbox"></td>
<td>{{ item.acct_num }}</td>
<td>{{'$ ' ~ item.amount}}</td>
</tr>
{% endfor %}
</table>
<br>
<h3 align="right">Total Petty Cash: <u>[webform_submission:values:petty_cash_voucher_01_total_petty_cash]</u></h3>
<br>
<div class="wrap">
<table id="signature" width="150">
<tr>
<th id="sign">Purchased/Received By:</th>
</tr>
<tr>
<td id="sign" height="100"></td>
</tr>
</table>
<table id="signature" width="150">
<tr>
<th id="sign">Approved By:</th>
</tr>
<tr>
<td id="sign" height="100"></td>
</tr>
</table>
<table id="signature" width="150">
<tr id="sign">
<th id="sign">Acct.Approval:</th>
</tr>
<tr>
<td height="100" id="sign"></td>
</tr>
</table>
</div>
<div>
<p>Must be approved per Authorized List.</p>
<p>Receipts, including detailed receipts, should be attached to form.</p>
</div>
</body>
I am using twig to display all the submitted data of a form in PDF Attachment field. After writing the twig code,
the form's title and the submission ID would not go away and mess up the template, and I do not even have them on twig.
the date and the p tag are not printed properly despite my code works fine in editor
Can anyone tell me why and how to fix the problem?
<style>
.wrap {
text-align: center;
}
#signature {
display: inline-table;
border-collapse: collapse;
table-layout: auto;
border: 1px solid rgba(5, 138, 222, 0.67);
empty-cells: show;
margin: 1%;
table-layout: auto;
}
#sign {
border: 1px solid rgba(5, 138, 222, 0.67);
padding: 10px;
}
th {
background-color: rgba(143, 220, 242, 0.67);
border: 1px solid rgba(5, 138, 222, 0.67);
border-left: 1px solid rgba(5, 138, 222, 0.67);
border-bottom: 1px solid rgba(5, 138, 222, 0.67);
color: #000000;
text-align: center;
font-weight: bold;
vertical-align: middle;
padding: .75em .5em;
}
td {
text-align: right;
border: 1px solid rgba(5, 138, 222, 0.67);
vertical-align: middle;
padding: .75em .5em;
}
#item {
border-collapse: collapse;
border: 1px solid rgba(5, 138, 222, 0.67);
empty-cells: show;
margin: 1%;
table-layout: auto;
width: 100%;
}
p {
font-weight: bold;
}
</style>
<body>
<h1 style="float: right;">Date: <u>[webform_submission:values:date_]</u></h1>
<table id="item">
<tr>
<th colspan="5">Expense Item</th>
</tr>
<tr>
<th>Service Purchased</th>
<th>Purpose</th>
<th>Receipt</th>
<th>Account Code</th>
<th>Amount</th>
</tr>
{% for item in data.voucher %}
<tr>
<td>{{item.date}}</td>
<td>{{item.purpose}}</td>
<td><input type="checkbox"></td>
<td>{{ item.acct_num }}</td>
<td>{{'$ ' ~ item.amount}}</td>
</tr>
{% endfor %}
</table>
<br>
<h3 align="right">Total Petty Cash: <u>[webform_submission:values:petty_cash_voucher_01_total_petty_cash]</u></h3>
<br>
<div class="wrap">
<table id="signature" width="150">
<tr>
<th id="sign">Purchased/Received By:</th>
</tr>
<tr>
<td id="sign" height="100"></td>
</tr>
</table>
<table id="signature" width="150">
<tr>
<th id="sign">Approved By:</th>
</tr>
<tr>
<td id="sign" height="100"></td>
</tr>
</table>
<table id="signature" width="150">
<tr id="sign">
<th id="sign">Acct.Approval:</th>
</tr>
<tr>
<td height="100" id="sign"></td>
</tr>
</table>
</div>
<div>
<p>Must be approved per Authorized List.</p>
<p>Receipts, including detailed receipts, should be attached to form.</p>
</div>
</body>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在您的网站中,转到Webform -> 配置 -> 表格 -> 实体打印 ->删除标题中的内容
In your site, go to Webform -> configuration -> forms -> entity print -> remove what's in the header