Page breaks with all sections on one page
I have a document with several sections and each section can be very varied as it is very dynamic. The requirement is that each section, if launched on a specific page, says, for example, section 1 appears on page 1 and section 2 starts on this page, below section 1 must appear on the same page if it can completely match another that needs to go to the next page. It's bcos the whole section should appear on one page ... Are there any things in CSS or XSLT that would be tricked. Any other ways were also rated as any good PDF writers who would achieve this requirement.
source to share
Yes, see page break before or page-break-after CSS Properties.
You can force each section to start on a new page with page-break-before
:
.section { page-break-before:always; }
Or, you can force any content that comes after the section to a new page with page-break-after
:
.section { page-break-after:always; }
source to share
FOP is a great tool (free) for creating PDF files. Inside FOP, you also have a property that can set page breaks:
keep-with-next.within-page="always"
source to share