我遇到了这样的问题,因为我不需要在其他
页数,我不想看到首页和第一行之间的边距
在第二页。我所做的是避免使用提供的外部布局
通过Odoo创建新的纸张格式,无页眉和页脚:
<!-- 0 mm header and 0mm bottom and less height -->
<field name="page_height">150</field>
<field name="margin_top">0</field>
<field name="margin_bottom">0</field>
然后我写了我的报告
<page>
,定义我自己的标题,以便在整个PDF中每个记录呈现一次。
<page>
<div class="new_header" style="margin-top: 1%;"> <!-- Margin-top here replaces the margin_top of the paper format -->
<!-- my header code here -->
<!-- don't user <header> element or class="header" because odoo will render it in the header section by default -->
<div>
我希望你能明白,这需要一些技巧
xpath
为了删除外部布局,或者,可以使用此技术定义新的报告。
请注意,删除页眉和底部空间的唯一方法是
页边距
.