ANS-1916 · PRINTING, PDF & EMAIL TEMPLATES
How to Insert a Page Break in NetSuite Advanced PDF/HTML Templates?
Leverage CSS properties within NetSuite's Advanced PDF/HTML templates to control content flow and ensure proper document formatting.
Short answer
To insert a page break in NetSuite Advanced PDF/HTML templates, utilize the page-break-before CSS property. Apply this property to the HTML element that should appear at the beginning of a new page, setting its value to always. This ensures specific content sections are correctly positioned on subsequent pages within generated PDF documents.
Scenario
Users often need to control the layout of generated PDF documents, specifically ensuring certain sections of content begin on a new page. This requirement is common when designing complex documents like invoices, statements, or reports using NetSuite's Advanced PDF/HTML templates. Without proper page break control, content may flow unexpectedly, leading to poorly formatted or unreadable documents.
Solution
To implement a page break in an Advanced PDF/HTML template, apply the page-break-before CSS property to the specific HTML element that needs to start on a new page.Consider the following example of an Advanced PDF/HTML template structure:
xml<?xml version="1.0"?><!DOCTYPE pdf PUBLIC "-//big.faceless.org//report" "report-1.1.dtd"><pdf><body><div class="firstPage>First Page Content</div><div class="secondPage>Second Page Content</div></body></pdf>To ensure the content within the secondPage div starts on a new page, define the following CSS rule:
css.secondPage { page-break-before: always; }By applying this CSS, any content within the secondPage div will automatically be rendered at the beginning of the next page in the generated PDF.
Expert NetSuite Support
Need help with this NetSuite issue?
Printing, PDF & Email Templates consulting and configuration support
