SplitterContext

Inheritance: java.lang.Object, com.aspose.words.ProcessorContext

public class SplitterContext extends ProcessorContext

Document splitter context.

Examples:

Shows how to split document by pages using context.


 String doc = getMyDir() + "Big document.docx";

 SplitterContext splitterContext = new SplitterContext();
 splitterContext.getSplitOptions().setSplitCriteria(SplitCriteria.PAGE);

 Splitter.create(splitterContext)
         .from(doc)
         .to(getArtifactsDir() + "LowCode.SplitContextDocument.docx")
         .execute();
 

Shows how to split document from the stream by pages using context.


 try (FileInputStream streamIn = new FileInputStream(getMyDir() + "Big document.docx")) {
     SplitterContext splitterContext = new SplitterContext();
     splitterContext.getSplitOptions().setSplitCriteria(SplitCriteria.PAGE);

     ArrayList pages = new ArrayList<>();
     Splitter.create(splitterContext)
             .from(streamIn)
             .toOutput(pages, SaveFormat.DOCX)
             .execute();
 }
 

Constructors

ConstructorDescription
SplitterContext()Initializes a new instance of this class.

Methods

MethodDescription
getFontSettings()Font settings used by the processor.
getLayoutOptions()Document layout options used by the processor.
getSplitOptions()Document split options.
getWarningCallback()Warning callback used by the processor.
setFontSettings(FontSettings value)Font settings used by the processor.
setWarningCallback(IWarningCallback value)Warning callback used by the processor.

SplitterContext()

public SplitterContext()

Initializes a new instance of this class.

getFontSettings()

public FontSettings getFontSettings()

Font settings used by the processor.

Returns: FontSettings - The corresponding FontSettings value.

getLayoutOptions()

public LayoutOptions getLayoutOptions()

Document layout options used by the processor.

Returns: LayoutOptions - The corresponding LayoutOptions value.

getSplitOptions()

public SplitOptions getSplitOptions()

Document split options.

Examples:

Shows how to split document by pages using context.


 String doc = getMyDir() + "Big document.docx";

 SplitterContext splitterContext = new SplitterContext();
 splitterContext.getSplitOptions().setSplitCriteria(SplitCriteria.PAGE);

 Splitter.create(splitterContext)
         .from(doc)
         .to(getArtifactsDir() + "LowCode.SplitContextDocument.docx")
         .execute();
 

Shows how to split document from the stream by pages using context.


 try (FileInputStream streamIn = new FileInputStream(getMyDir() + "Big document.docx")) {
     SplitterContext splitterContext = new SplitterContext();
     splitterContext.getSplitOptions().setSplitCriteria(SplitCriteria.PAGE);

     ArrayList pages = new ArrayList<>();
     Splitter.create(splitterContext)
             .from(streamIn)
             .toOutput(pages, SaveFormat.DOCX)
             .execute();
 }
 

Returns: SplitOptions - The corresponding SplitOptions value.

getWarningCallback()

public IWarningCallback getWarningCallback()

Warning callback used by the processor.

Returns: IWarningCallback - The corresponding IWarningCallback value.

setFontSettings(FontSettings value)

public void setFontSettings(FontSettings value)

Font settings used by the processor.

Parameters:

ParameterTypeDescription
valueFontSettingsThe corresponding FontSettings value.

setWarningCallback(IWarningCallback value)

public void setWarningCallback(IWarningCallback value)

Warning callback used by the processor.

Parameters:

ParameterTypeDescription
valueIWarningCallbackThe corresponding IWarningCallback value.