I am using Jinja to fetch and display content from a “Text Editor” field in a custom print format in ERPNext/Frappe. However, if the content from the “Text Editor” field is too long to fit on one page, the system adds a blank page before displaying the content, even if the content should fit on the same page initially.
The content of the “Text Editor” field should appear immediately after the previous section, without adding a blank page.
How can I prevent this unnecessary blank page from being added before the “Text Editor” content? Any advice on fixing this issue
It’s likely caused by page breaks or extra spaces in the layout. To fix it, check if there’s any CSS code that forces a page break, like page-break-before, and remove it. Also, make sure the content doesn’t have too much margin or padding and that no extra containers are pushing it to a new page. Use CSS to prevent automatic page breaks and ensure everything fits smoothly on the same page.
There’s a lot of code, which makes it hard to check but after checking the code, as per my understanding, first check if any extra margins or padding are pushing content to the next page and remove them. Make sure there are no CSS rules that force a page break before your content. Simplify your HTML structure to avoid layout issues, and adjust your CSS settings to make sure the header and footer spaces are set to 0.