跳至内容
菜单
此问题已终结
1 回复
1760 查看

Hi, i got this custom report (model sale.order) and i have added an svg and also an image so the svg is fixed to the upper right corner and the image is fixed to the lower left corner:

the html i'm using is inside of a web.basic_layout, inside is the div with the 'page' class, then inside this last div i got another div with the next style:


style="position: fixed; top: 272.9mm; left: 0;"


inside this div i have the image


next to this div i have the svg with the next style:

style="position: absolute; top: 0; right: 0; width: 330px; height: 160px;"


and below things like tables and stuff.


But when the infor overflows the current page, the next page does not contains the svg and the image, i m using a paperformat with the next config:

format: Letter
orientation: portrait,

all the margins set to 0

形象
丢弃
最佳答案

Hi,

To make the SVG and image appear on every page:

1. Move them outside the main content div.

2. Put the SVG in a div with the class "header".

3. Put the image in a div with class "footer".

4. Keep your main content in the div with class "page".

5. Use position: absolute instead of fixed.

For example,use the following xml code as reference:


<t t-call="web.basic_layout">
    <!-- Header div for the SVG -->
    <div class="header">
        <div t-attf-style="position: absolute; top: 0; right: 0; width: 330px; height: 160px;">
            <!-- Your SVG code here -->
        </div>
    </div>

    <!-- Footer div for the image -->
    <div class="footer">
        <div t-attf-style="position: absolute; bottom: 0; left: 0;">
<img t-att-src="'/path/to/your/image'"/>
        </div>
    </div>

    <!-- Main content -->
    <div class="page">
        <!-- Your main content (tables, etc.) goes here -->
    </div>
</t>


Hope it helps.


形象
丢弃
相关帖文 回复 查看 活动
2
9月 24
2867
0
7月 24
1013
2
7月 25
1072
1
11月 24
1335
0
10月 24
1158