Heading
Overview
Heading is a class in Aspose.Pdf FOSS for Java.
Inherits from: BaseParagraph.
Represents a heading element that can be used in a table of contents.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
level | int | Read | Returns the heading level. |
text | String | Read | Returns the display text of this heading. |
tocPage | Page | Read | Returns the TOC page where this heading entry appears. |
destinationPage | Page | Read | Returns the destination page that this heading links to. |
top | double | Read | Returns the top Y coordinate for the destination on the target page. |
segments | List<TextSegment> | Read | Returns the list of text segments composing this heading. |
autoSequence | boolean | Read | Returns whether this heading is auto-sequenced in the TOC. |
inList | boolean | Read | Returns whether this heading appears in the TOC list. |
style | NumberingStyle | Read | Returns the numbering style for this heading. |
startNumber | int | Read | Returns the start number for auto-sequencing. |
textState | TextState | Read | Returns the text state (font, size, color) for this heading. |
horizontalAlignment | HorizontalAlignment | Read | Returns the horizontal alignment. |
margin | MarginInfo | Read | Gets the margin information for this paragraph. |
inLineParagraph | boolean | Read | Returns whether this paragraph is an inline element. |
keptWithNext | boolean | Read | Returns whether this paragraph should be kept together with the next paragraph |
| on the same page during layout. | |||
firstParagraphInColumn | boolean | Read | Returns whether this paragraph is the first in its column. |
inNewPage | boolean | Read | Returns whether this paragraph should start on a new page during layout. |
hyperlink | Hyperlink | Read | Returns the hyperlink attached to this paragraph (web, local or file |
| target), or {@code null} if the paragraph is not clickable. |
Methods
| Signature | Description |
|---|---|
Heading(level: int) | Creates a heading with the specified level. |
getLevel() → int | Returns the heading level. |
setLevel(level: int) | Sets the heading level. |
getText() → String | Returns the display text of this heading. |
setText(text: String) | Sets the display text of this heading. |
getTocPage() → Page | Returns the TOC page where this heading entry appears. |
setTocPage(tocPage: Page) | Sets the TOC page where this heading entry appears. |
getDestinationPage() → Page | Returns the destination page that this heading links to. |
setDestinationPage(destinationPage: Page) | Sets the destination page that this heading links to. |
getTop() → double | Returns the top Y coordinate for the destination on the target page. |
setTop(top: double) | Sets the top Y coordinate for the destination on the target page. |
getSegments() → List<TextSegment> | Returns the list of text segments composing this heading. |
isAutoSequence() → boolean | Returns whether this heading is auto-sequenced in the TOC. |
setIsAutoSequence(autoSequence: boolean) | Sets whether this heading is auto-sequenced in the TOC. |
isInList() → boolean | Returns whether this heading appears in the TOC list. |
setIsInList(inList: boolean) | Sets whether this heading appears in the TOC list. |
getStyle() → NumberingStyle | Returns the numbering style for this heading. |
setStyle(style: NumberingStyle) | Sets the numbering style for this heading. |
getStartNumber() → int | Returns the start number for auto-sequencing. |
setStartNumber(startNumber: int) | Sets the start number for auto-sequencing. |
getTextState() → TextState | Returns the text state (font, size, color) for this heading. |
getHorizontalAlignment() → HorizontalAlignment | Returns the horizontal alignment. |
setHorizontalAlignment(alignment: HorizontalAlignment) | Sets the horizontal alignment. |
getMargin() → MarginInfo | Gets the margin information for this paragraph. |
setMargin(margin: MarginInfo) | Sets the margin information for this paragraph. |
isInLineParagraph() → boolean | Returns whether this paragraph is an inline element. |
setInLineParagraph(inLineParagraph: boolean) | Sets whether this paragraph should be treated as an inline element. |
isKeptWithNext() → boolean | Returns whether this paragraph should be kept together with the next paragraph |
| on the same page during layout. | |
setKeptWithNext(keptWithNext: boolean) | Sets whether this paragraph should be kept together with the next paragraph |
| on the same page during layout. | |
isFirstParagraphInColumn() → boolean | Returns whether this paragraph is the first in its column. |
setFirstParagraphInColumn(firstParagraphInColumn: boolean) | Sets whether this paragraph is the first in its column. |
isInNewPage() → boolean | Returns whether this paragraph should start on a new page during layout. |
setInNewPage(inNewPage: boolean) | Sets whether this paragraph should start on a new page during layout. |
getHyperlink() → Hyperlink | Returns the hyperlink attached to this paragraph (web, local or file |
| target), or {@code null} if the paragraph is not clickable. | |
setHyperlink(hyperlink: Hyperlink) | Attaches a hyperlink to this paragraph. |