public class HeadingLevels extends Object
Represents a class to work with header levels based on font size.
Constructor and Description |
---|
HeadingLevels()
Creates a new instance of the HeadingLevels class.
|
HeadingLevels(double threshold)
Creates a new instance of the HeadingLevels class.
|
Modifier and Type | Method and Description |
---|---|
void |
addLevels(Iterable<Double> fontSizes)
Adds heading levels.
|
int |
estimateLevel(double fontSize)
Estimates the possible header level.
|
boolean |
findLevel(double fontSize,
int[] level)
Finds level for corresponding font size.
|
com.aspose.ms.System.Collections.IEnumerable<Double> |
getAllLevels()
Gets all heading levels.
|
public HeadingLevels()
Creates a new instance of the HeadingLevels class.
public HeadingLevels(double threshold)
Creates a new instance of the HeadingLevels class.
threshold
- The threshold value to compare font sizes.
Within the threshold, the header levels are the same.
The threshold default value is 0.01.public final com.aspose.ms.System.Collections.IEnumerable<Double> getAllLevels()
Gets all heading levels.
public final void addLevels(Iterable<Double> fontSizes)
Adds heading levels. Font size collection should be sorted by decreasing size.
fontSizes
- Values should be sorted in decreasing order.com.aspose.ms.System.ArgumentException
- If the value is not sorted or the value is less than one.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.
fontSize
- The font size.public final boolean findLevel(double fontSize, int[] level)
Finds level for corresponding font size. Looking for an exact match.
fontSize
- The font size.level
- The corresponding heading level for given font size.Copyright © 2024 Aspose. All Rights Reserved.