iText 8.0.4 API
iText.Layout.Properties.ParagraphWidowsControl Class Reference

A specialized class holding configurable parameters related to iText.Layout.Element.Paragraph 's widows restrictions. More...

Public Member Functions

  ParagraphWidowsControl (int minWidows, int maxLinesToMove, bool overflowParagraphOnViolation)
  Creates a ParagraphWidowsControl instance with specified widows restrictions. More...
 
virtual iText.Layout.Properties.ParagraphWidowsControl  SetMinAllowedWidows (int minWidows, int maxLinesToMove, bool overflowParagraphOnViolation)
  Sets parameters that define widows restrictions and conditions of handling cases of widows constraint violation. More...
 
virtual int  GetMinWidows ()
  Gets minimal number of paragraph's lines to be overflowed to the next area. More...
 
virtual int  GetMaxLinesToMove ()
  Gets a number of lines that are allowed to be moved to the next area in order to fix widows constraint violation. More...
 
virtual bool  IsOverflowOnWidowsViolation ()
  Indicates whether paragraph should be completely pushed to the next area if widows constraint is violated and cannot be automatically fixed. More...
 
virtual void  HandleViolatedWidows (ParagraphRenderer widowsRenderer, String message)
  Writes a log message reporting that widows constraint is violated and cannot be automatically fixed. More...
 

Detailed Description

A specialized class holding configurable parameters related to iText.Layout.Element.Paragraph 's widows restrictions.

A specialized class holding configurable parameters related to iText.Layout.Element.Paragraph 's widows restrictions. This class is meant to be used as the value for the Property.WIDOWS_CONTROL key.

Constructor & Destructor Documentation

◆ ParagraphWidowsControl()

iText.Layout.Properties.ParagraphWidowsControl.ParagraphWidowsControl ( int  minWidows,
int  maxLinesToMove,
bool  overflowParagraphOnViolation 
)
inline

Creates a ParagraphWidowsControl instance with specified widows restrictions.

Parameters
minWidows minimal number of paragraph's lines to be overflowed to the next area.
maxLinesToMove a number of lines that are allowed to be moved to the next area in order to fix widows constraint violation.
overflowParagraphOnViolation defines whether the entire paragraph should be pushed to the next area if widows constraint is violated and cannot be automatically fixed.

Member Function Documentation

◆ GetMaxLinesToMove()

virtual int iText.Layout.Properties.ParagraphWidowsControl.GetMaxLinesToMove ( )
inlinevirtual

Gets a number of lines that are allowed to be moved to the next area in order to fix widows constraint violation.

Returns
a number of lines that are allowed to be moved to the next are

◆ GetMinWidows()

virtual int iText.Layout.Properties.ParagraphWidowsControl.GetMinWidows ( )
inlinevirtual

Gets minimal number of paragraph's lines to be overflowed to the next area.

Returns
minimal number of paragraph's lines to be overflowed to the next area

◆ HandleViolatedWidows()

virtual void iText.Layout.Properties.ParagraphWidowsControl.HandleViolatedWidows ( ParagraphRenderer  widowsRenderer,
String  message 
)
inlinevirtual

Writes a log message reporting that widows constraint is violated and cannot be automatically fixed.

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.

Parameters
widowsRenderer a renderer processing widows
message

System.String explaining the reason for violation

◆ IsOverflowOnWidowsViolation()

virtual bool iText.Layout.Properties.ParagraphWidowsControl.IsOverflowOnWidowsViolation ( )
inlinevirtual

Indicates whether paragraph should be completely pushed to the next area if widows constraint is violated and cannot be automatically fixed.

Returns
true if paragraph should be completely pushed to the next area if widows constraint is violated and cannot be automatically fixed, otherwise - false

◆ SetMinAllowedWidows()

virtual iText.Layout.Properties.ParagraphWidowsControl iText.Layout.Properties.ParagraphWidowsControl.SetMinAllowedWidows ( int  minWidows,
int  maxLinesToMove,
bool  overflowParagraphOnViolation 
)
inlinevirtual

Sets parameters that define widows restrictions and conditions of handling cases of widows constraint violation.

Parameters
minWidows minimal number of paragraph's lines to be overflowed to the next area.
maxLinesToMove a number of lines that are allowed to be moved to the next area in order to fix widows constraint violation.
overflowParagraphOnViolation defines whether paragraph should be completely pushed to the next area if widows constraint is violated and cannot be automatically fixed.
Returns
this ParagraphWidowsControl instance.