Split

Split(string, string, SplitOptions)

Splits a document into multiple parts based on the specified split options and saves the resulting parts to files. The output file format is determined by the extension of the output file name.

public static void Split(string inputFileName, string outputFileName, SplitOptions options)
ParameterTypeDescription
inputFileNameStringThe input file name.
outputFileNameStringThe output file name used to generate file name for document parts using rule “outputFile_partIndex.extension”
optionsSplitOptionsDocument split options.

Examples

Shows how to split document by pages.

string doc = MyDir + "Big document.docx";

Splitter.Split(doc, ArtifactsDir + "LowCode.SplitDocument.1.docx", new SplitOptions() { SplitCriteria = SplitCriteria.Page });
Splitter.Split(doc, ArtifactsDir + "LowCode.SplitDocument.2.docx", SaveFormat.Docx, new SplitOptions() { SplitCriteria = SplitCriteria.Page });

See Also


Split(string, string, SaveFormatSplitOptions)

Splits a document into multiple parts based on the specified split options and saves the resulting parts to files in the specified save format.

public static void Split(string inputFileName, string outputFileName, SaveFormat saveFormat, 
    SplitOptions options)
ParameterTypeDescription
inputFileNameStringThe input file name.
outputFileNameStringThe output file name used to generate file name for document parts using rule “outputFile_partIndex.extension”
saveFormatSaveFormatThe save format.
optionsSplitOptionsDocument split options.

Examples

Shows how to split document by pages.

string doc = MyDir + "Big document.docx";

Splitter.Split(doc, ArtifactsDir + "LowCode.SplitDocument.1.docx", new SplitOptions() { SplitCriteria = SplitCriteria.Page });
Splitter.Split(doc, ArtifactsDir + "LowCode.SplitDocument.2.docx", SaveFormat.Docx, new SplitOptions() { SplitCriteria = SplitCriteria.Page });

See Also


Split(Stream, SaveFormatSplitOptions)

Splits a document from an input stream into multiple parts based on the specified split options and returns the resulting parts as an array of streams in the specified save format.

public static Stream[] Split(Stream inputStream, SaveFormat saveFormat, SplitOptions options)
ParameterTypeDescription
inputStreamStreamThe input stream.
saveFormatSaveFormatThe save format.
optionsSplitOptionsDocument split options.

Examples

Shows how to split document from the stream by pages.

using (FileStream streamIn = new FileStream(MyDir + "Big document.docx", FileMode.Open, FileAccess.Read))
{
    Stream[] stream = Splitter.Split(streamIn, SaveFormat.Docx, new SplitOptions() { SplitCriteria = SplitCriteria.Page });
}

See Also