Section Class
Defines a section in the document.
Declaration
export class Section
Properties
columnCount Property
Specifies the number of columns in the section’s main document.
Declaration
columnCount: number
Property Value
Type | Description |
---|---|
number | The number of columns. |
Remarks
var sectionColumnCount = richEdit.document.sections.getByIndex(1).columnCount;
footerOffset Property
Specifies the footer offset.
Declaration
footerOffset: number
Property Value
Type | Description |
---|---|
number | The offset, in twips. |
headerOffset Property
Specifies the header offset.
Declaration
headerOffset: number
Property Value
Type | Description |
---|---|
number | The offset, in twips. |
index Property
Returns the the zero-based index of the section in the sections collection.
Declaration
readonly index: number
Property Value
Type | Description |
---|---|
number | The section index. |
Remarks
You can use the getByIndex(index) method to find a section by its index in the SectionCollection object.
var firstSection = richEdit.document.sections.getByIndex(1);
interval Property
Gets the text buffer interval occupied by the current section.
Declaration
readonly interval: Interval
Property Value
Type | Description |
---|---|
Interval | An object that contains the interval settings. |
margins Property
Specifies the margins of the section’s pages.
Declaration
margins: Margins
Property Value
Type | Description |
---|---|
Margins | An object that contains margin settings, in twips. |
Remarks
richEdit.document.sections.getByIndex(1).margins = new DevExpress.RichEdit.Margins(1000,1000,1000,1000);
pageSize Property
Specifies the size of the section’s pages.
Declaration
pageSize: Size
Property Value
Type | Description |
---|---|
Size | An object that contains a page size, in twips. |
Remarks
richEdit.document.sections.getByIndex(0).pageSize = new DevExpress.RichEdit.Size(8500,8500);
Methods
getFooter(type) Method
Returns a sub-document that is the section’s footer.
Declaration
getFooter(
type: HeaderFooterType,
createIfNotExist?: boolean
): SubDocument | null
Parameters
Name | Type | Description |
---|---|---|
type | HeaderFooterType | The type of footer to return. |
createIfNotExist | boolean | true to create a footer if it does not exist; false to not create a footer. |
Returns
Type | Description |
---|---|
SubDocument | The section’s footer (existing or newly created). |
null | The section does not have a footer. |
getHeader(type) Method
Returns a sub-document that is the section’s header.
Declaration
getHeader(
type: HeaderFooterType,
createIfNotExist?: boolean
): SubDocument | null
Parameters
Name | Type | Description |
---|---|---|
type | HeaderFooterType | The type of header to return. |
createIfNotExist | boolean | true to create a header if it does not exist; false to not create a header. |
Returns
Type | Description |
---|---|
SubDocument | The section’s header (existing or newly created). |
null | The section does not have a header. |
Remarks
//Creates a header and populate it with a text
var sd = richEdit.document.sections.getByIndex(0).getHeader(DevExpress.RichEdit.HeaderFooterType.Primary, true);
sd.insertText(0, 'sometext')