HeadingLevels

Inheritance: java.lang.Object, com.aspose.pdf.markdownoptions.HeadingLevels

public class HeadingLevels extends Object

Represents a class to work with header levels based on font size.

Constructors

ConstructorDescription
HeadingLevelsCreates a new instance of the HeadingLevels class.
HeadingLevelsCreates a new instance of the HeadingLevels class.

Methods

MethodDescription
addLevelsAdds heading levels.
estimateLevelEstimates the possible header level. If fontSize is not found in the list of levels, the level closest to this font size value will be returned. If fontSize is outside the minimum and maximum header levels specified, the method will return false.
findLevelFinds level for corresponding font size. Looking for an exact match.
getAllLevelsGets all heading levels.

HeadingLevels

public HeadingLevels()

Creates a new instance of the HeadingLevels class.

HeadingLevels

public HeadingLevels(double threshold)

Creates a new instance of the HeadingLevels class.

Parameters:

ParameterTypeDescription
thresholdThe threshold value to compare font sizes. Within the threshold, the header levels are the same. The threshold default value is 0.01.

addLevels

Adds heading levels.

estimateLevel

public final int estimateLevel(double fontSize)

Estimates the possible header level. If fontSize is not found in the list of levels, the level closest to this font size value will be returned. If fontSize is outside the minimum and maximum header levels specified, the method will return false.

Parameters:

ParameterTypeDescription
fontSizeThe font size.

Returns: Heading level.

findLevel

public final boolean findLevel(double fontSize, int[] level)

Finds level for corresponding font size. Looking for an exact match.

Parameters:

ParameterTypeDescription
fontSizeThe font size.
levelThe corresponding heading level for given font size.

Returns: False If the fontSize is not within the specified range.

getAllLevels

public final com.aspose.ms.System.Collections.IEnumerable< Double > getAllLevels()

Gets all heading levels.

Returns: IEnumerable of Double