Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

Section Class

Defines a section in the document.

#Declaration

TypeScript
export class Section

#Properties

#columnCount Property

Specifies the number of columns in the section’s main document.

#Declaration

TypeScript
get columnCount(): number
set columnCount(columnCount: number)

#Property Value

Type Description
number

The number of columns.

#Remarks

var sectionColumnCount = richEdit.document.sections.getByIndex(0).columnCount;

#footerOffset Property

Specifies the footer offset.

#Declaration

TypeScript
get footerOffset(): number
set footerOffset(offset: number)

#Property Value

Type Description
number

The offset in twips.

#headerOffset Property

Specifies the header offset.

#Declaration

TypeScript
get headerOffset(): number
set headerOffset(offset: number)

#Property Value

Type Description
number

The offset in twips.

#index Property

Returns the zero-based index of the section in the sections collection.

#Declaration

TypeScript
get 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(0);

#interval Property

Gets the text buffer interval occupied by the current section.

#Declaration

TypeScript
get interval(): Interval

#Property Value

Type Description
Interval

An object that contains the interval settings.

#landscape Property

Specifies whether the section’s page orientation is landscape.

#Declaration

TypeScript
get landscape(): boolean
set landscape(landscape: boolean)

#Property Value

Type Description
boolean

true if the page orientation is landscape; false if the page orientation is portrait.

#margins Property

Specifies the margins of the section’s pages.

#Declaration

TypeScript
get margins(): Margins
set margins(margins: Margins)

#Property Value

Type Description
Margins

An object that contains margin settings in twips.

#Remarks

var marginSize = richEdit.unitConverter.centimetersToTwips(1);
var margins = new DevExpress.RichEdit.Margins(
    marginSize, marginSize, marginSize, marginSize);
richEdit.document.sections.getByIndex(0).margins = margins;

#pageSize Property

Specifies the size of the section’s pages.

#Declaration

TypeScript
get pageSize(): Size
set pageSize(size: Size)

#Property Value

Type Description
Size

An object that contains a page size in twips.

#Remarks

var size = new DevExpress.RichEdit.Size(
    richEdit.unitConverter.centimetersToTwips(24),
    richEdit.unitConverter.centimetersToTwips(18));
richEdit.document.sections.getByIndex(0).pageSize = size;

#paperSize Property

Specifies the size of the section’s pages.

#Declaration

TypeScript
get paperSize(): PaperSize
set paperSize(paperSize: PaperSize)

#Property Value

Type Description
PaperSize

The paper size.

#Methods

#getFooter Method

Returns a sub-document that is the section’s footer.

#Declaration

TypeScript
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 if the section does not have a footer.

#Remarks

var section = richEdit.document.sections.getByIndex(0);
var subDocument = section.getFooter(DevExpress.RichEdit.HeaderFooterType.Primary, true);
See Also

#getHeader Method

Returns a sub-document that is the section’s header.

#Declaration

TypeScript
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 if the section does not have a header.

#Remarks

var section = richEdit.document.sections.getByIndex(0);
var subDocument = section.getHeader(DevExpress.RichEdit.HeaderFooterType.Primary, true);
See Also