public
|
calculate_bottom_page_edge(): void
Calculate the bottom edge of the page area after margins have been
applied for the current page.
Calculate the bottom edge of the page area after margins have been
applied for the current page.
|
#
|
public
|
next_page()
Start a new page by resetting the full flag.
Start a new page by resetting the full flag.
|
#
|
public
|
check_forced_page_break(AbstractFrameDecorator $frame): bool
Check if a forced page break is required before $frame. This uses the
frame's page_break_before property as well as…
Check if a forced page break is required before $frame. This uses the
frame's page_break_before property as well as the preceding frame's
page_break_after property.
Parameters
| $frame |
the frame to check
|
Returns
true if a page break occurred
|
#
|
protected
|
hasGap(float $childPos, Frame $frame): bool
Check for a gap between the top content edge of a frame and its child
content.
Check for a gap between the top content edge of a frame and its child
content.
Additionally, the top margin, border, and padding of the frame must fit
on the current page.
Parameters
| $childPos |
The top margin or line-box edge of the child content.
|
| $frame |
The parent frame to check.
|
|
#
|
protected
|
_page_break_allowed(AbstractFrameDecorator $frame): bool
Determine if a page break is allowed before $frame
http://www.w3.org/TR/CSS21/page.html#allowed-page-breaks
Determine if a page break is allowed before $frame
http://www.w3.org/TR/CSS21/page.html#allowed-page-breaks
In the normal flow, page breaks can occur at the following places:
- In the vertical margin between block boxes. When an
unforced page break occurs here, the used values of the
relevant 'margin-top' and 'margin-bottom' properties are set
to '0'. When a forced page break occurs here, the used value
of the relevant 'margin-bottom' property is set to '0'; the
relevant 'margin-top' used value may either be set to '0' or
retained.
2. Between line boxes inside a block container box.
3. Between the content edge of a block container box and the
outer edges of its child content (margin edges of block-level
children or line box edges for inline-level children) if there
is a (non-zero) gap between them.
These breaks are subject to the following rules:
-
Rule A: Breaking at (1) is allowed only if the
'page-break-after' and 'page-break-before' properties of all
the elements generating boxes that meet at this margin allow
it, which is when at least one of them has the value
'always', 'left', or 'right', or when all of them are 'auto'.
-
Rule B: However, if all of them are 'auto' and a common
ancestor of all the elements has a 'page-break-inside' value
of 'avoid', then breaking here is not allowed.
-
Rule C: Breaking at (2) is allowed only if the number of line
boxes between the break and the start of the enclosing block
box is the value of 'orphans' or more, and the number of line
boxes between the break and the end of the box is the value
of 'widows' or more.
-
Rule D: In addition, breaking at (2) or (3) is allowed only
if the 'page-break-inside' property of the element and all
its ancestors is 'auto'.
If the above does not provide enough break points to keep content
from overflowing the page boxes, then rules A, B and D are
dropped in order to find additional breakpoints.
If that still does not lead to sufficient break points, rule C is
dropped as well, to find still more break points.
We also allow breaks between table rows.
Parameters
| $frame |
the frame to check
|
Returns
true if a break is allowed, false otherwise
|
#
|
public
|
check_page_break(AbstractFrameDecorator $frame): bool
Check if $frame will fit on the page. If the frame does not fit,
the frame tree is modified so that a page break…
Check if $frame will fit on the page. If the frame does not fit,
the frame tree is modified so that a page break occurs in the
correct location.
Parameters
| $frame |
the frame to check
|
|
#
|