Class ParagraphWidowsControl
- Namespace
- iText.Layout.Properties
- Assembly
- itext.layout.dll
A specialized class holding configurable parameters related to Paragraph 's widows restrictions.
public class ParagraphWidowsControl
- Inheritance
-
ParagraphWidowsControl
- Inherited Members
Remarks
A specialized class holding configurable parameters related to Paragraph 's widows restrictions. This class is meant to be used as the value for the WIDOWS_CONTROL key.
Constructors
ParagraphWidowsControl(int, int, bool)
Creates a ParagraphWidowsControl instance with specified widows restrictions.
public ParagraphWidowsControl(int minWidows, int maxLinesToMove, bool overflowParagraphOnViolation)
Parameters
minWidows
intminimal number of paragraph's lines to be overflowed to the next area.
maxLinesToMove
inta number of lines that are allowed to be moved to the next area in order to fix widows constraint violation.
overflowParagraphOnViolation
booldefines whether the entire paragraph should be pushed to the next area if widows constraint is violated and cannot be automatically fixed.
Methods
GetMaxLinesToMove()
Gets a number of lines that are allowed to be moved to the next area in order to fix widows constraint violation.
public virtual int GetMaxLinesToMove()
Returns
- int
a number of lines that are allowed to be moved to the next are
GetMinWidows()
Gets minimal number of paragraph's lines to be overflowed to the next area.
public virtual int GetMinWidows()
Returns
- int
minimal number of paragraph's lines to be overflowed to the next area
HandleViolatedWidows(ParagraphRenderer, string)
Writes a log message reporting that widows constraint is violated and cannot be automatically fixed.
public virtual void HandleViolatedWidows(ParagraphRenderer widowsRenderer, string message)
Parameters
widowsRenderer
ParagraphRenderera renderer processing widows
message
stringstring explaining the reason for violation
Remarks
Writes a log message reporting that widows constraint is violated and cannot be automatically fixed. This method is to be overridden if violation scenarios need to be handled in some other way.
IsOverflowOnWidowsViolation()
Indicates whether paragraph should be completely pushed to the next area if widows constraint is violated and cannot be automatically fixed.
public virtual bool IsOverflowOnWidowsViolation()
Returns
- bool
true if paragraph should be completely pushed to the next area if widows constraint is violated and cannot be automatically fixed, otherwise - false
SetMinAllowedWidows(int, int, bool)
Sets parameters that define widows restrictions and conditions of handling cases of widows constraint violation.
public virtual ParagraphWidowsControl SetMinAllowedWidows(int minWidows, int maxLinesToMove, bool overflowParagraphOnViolation)
Parameters
minWidows
intminimal number of paragraph's lines to be overflowed to the next area.
maxLinesToMove
inta number of lines that are allowed to be moved to the next area in order to fix widows constraint violation.
overflowParagraphOnViolation
booldefines whether paragraph should be completely pushed to the next area if widows constraint is violated and cannot be automatically fixed.
Returns
- ParagraphWidowsControl
this ParagraphWidowsControl instance.