Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
212 Lượt xem

Hello Odooers,


I just have a question, is there any possible way to add page break in my formatting? Just like how you add section/note/etc I assumed there would be a page separator option as well for proper formatting.


Sometimes my invoices are two pages (second page being just like three words). At the moment, we are changing the margin manually which is tedious and time wasting. 

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hello Ammar,

You need to write page-break-before: always or page-break-after:always as per your need in PDF report file.
Hope it helps

Thanks.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,


In Odoo QWeb reports (like invoices), you can add page breaks to control PDF formatting, similar to sections or notes. This is done using a <div> with CSS: either style="page-break-before: always;" to start a new page or style="page-break-after: always;" to end the current page and move content to the next.


For better maintainability, you can define a CSS class, e.g., .page-break { page-break-after: always; }, and insert <div class="page-break"/> in your template. This works with wkhtmltopdf-generated PDFs and is best placed between sections rather than inside tables to avoid layout issues. Using page breaks prevents mostly blank second pages and eliminates the need to manually adjust margins.



Hope it helps

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 9 25
379
3
thg 2 25
3416
1
thg 11 24
3354
1
thg 12 23
3105
1
thg 4 21
8216