com.aspose.words
Class BreakType

java.lang.Object
    extended by com.aspose.words.BreakType

public class BreakType 
extends java.lang.Object

Utility class containing constants. Specifies type of a break inside a document.

Example:

Shows how to insert sections using DocumentBuilder, specify page setup for a section and reset page setup to defaults.
DocumentBuilder builder = new DocumentBuilder();

// Modify the first section in the document.
builder.getPageSetup().setOrientation(Orientation.LANDSCAPE);
builder.getPageSetup().setVerticalAlignment(PageVerticalAlignment.CENTER);
builder.writeln("Section 1, landscape oriented and text vertically centered.");

// Start a new section and reset its formatting to defaults.
builder.insertBreak(BreakType.SECTION_BREAK_NEW_PAGE);
builder.getPageSetup().clearFormatting();
builder.writeln("Section 2, back to default Letter paper size, portrait orientation and top alignment.");

builder.getDocument().save(getMyDir() + "PageSetup.ClearFormatting Out.doc");

Example:

Creates headers and footers in a document using DocumentBuilder.
// Create a blank document.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Specify that we want headers and footers different for first, even and odd pages.
builder.getPageSetup().setDifferentFirstPageHeaderFooter(true);
builder.getPageSetup().setOddAndEvenPagesHeaderFooter(true);

// Create the headers.
builder.moveToHeaderFooter(HeaderFooterType.HEADER_FIRST);
builder.write("Header First");
builder.moveToHeaderFooter(HeaderFooterType.HEADER_EVEN);
builder.write("Header Even");
builder.moveToHeaderFooter(HeaderFooterType.HEADER_PRIMARY);
builder.write("Header Odd");

// Create three pages in the document.
builder.moveToSection(0);
builder.writeln("Page1");
builder.insertBreak(BreakType.PAGE_BREAK);
builder.writeln("Page2");
builder.insertBreak(BreakType.PAGE_BREAK);
builder.writeln("Page3");

doc.save(getMyDir() + "DocumentBuilder.HeadersAndFooters Out.doc");

Field Summary
static final intPARAGRAPH_BREAK
           Break between paragraphs.
static final intPAGE_BREAK
           Explicit page break.
static final intCOLUMN_BREAK
           Explicit column break.
static final intSECTION_BREAK_CONTINUOUS
           Specifies start of new section on the same page as the previous section.
static final intSECTION_BREAK_NEW_COLUMN
           Specifies start of new section in the new column.
static final intSECTION_BREAK_NEW_PAGE
           Specifies start of new section on a new page.
static final intSECTION_BREAK_EVEN_PAGE
           Specifies start of new section on a new even page.
static final intSECTION_BREAK_ODD_PAGE
           Specifies start of new section on a odd page.
static final intLINE_BREAK
           Explicit line break.
 

Field Detail

PARAGRAPH_BREAK

public static final int PARAGRAPH_BREAK
Break between paragraphs.

PAGE_BREAK

public static final int PAGE_BREAK
Explicit page break.

COLUMN_BREAK

public static final int COLUMN_BREAK
Explicit column break.

SECTION_BREAK_CONTINUOUS

public static final int SECTION_BREAK_CONTINUOUS
Specifies start of new section on the same page as the previous section.

SECTION_BREAK_NEW_COLUMN

public static final int SECTION_BREAK_NEW_COLUMN
Specifies start of new section in the new column.

SECTION_BREAK_NEW_PAGE

public static final int SECTION_BREAK_NEW_PAGE
Specifies start of new section on a new page.

SECTION_BREAK_EVEN_PAGE

public static final int SECTION_BREAK_EVEN_PAGE
Specifies start of new section on a new even page.

SECTION_BREAK_ODD_PAGE

public static final int SECTION_BREAK_ODD_PAGE
Specifies start of new section on a odd page.

LINE_BREAK

public static final int LINE_BREAK
Explicit line break.

See Also:
          Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
          Aspose.Words Support Forum - our preferred method of support.