Editor

Editor(DocumentFormatBase)

Initializes a new instance of the Editor class and creates a new empty document based on the specified format.

public Editor(DocumentFormatBase format)
Parameter Type Description
format DocumentFormatBase Represents the file format of the document that will be created.

Remarks

Learn more

Examples

IDocumentFormat format = new WordProcessingFormats.Docx();
using (Editor editor = new Editor(format))
{
    // Use the editor instance to edit and save documents
}

See Also


Editor(Stream)

Initializes new Editor instance with specified input document (as a stream).

public Editor(Stream document)
Parameter Type Description
document Stream Stream that contains document content. Should not be null.

Remarks

Learn more

Examples

using (FileStream fs = new FileStream("input.docx", FileMode.Open, FileAccess.Read))
{
    using (Editor editor = new Editor(fs))
    {
        // Use the editor instance to edit and save documents
    }
}

See Also


Editor(Stream, ILoadOptions)

Initializes new Editor instance with specified input document (as a stream) with its load options.

public Editor(Stream document, ILoadOptions loadOptions)
Parameter Type Description
document Stream Stream that contains document content. Should not be null.
loadOptions ILoadOptions Document load options. May be null.

Exceptions

exception condition
ArgumentNullException Thrown when the document stream is null.
ArgumentException Thrown when the document stream is invalid.

Remarks

Learn more

Examples

using (FileStream fs = new FileStream("input.docx", FileMode.Open, FileAccess.Read))
{
    ILoadOptions loadOptions = new WordProcessingLoadOptions();
    using (Editor editor = new Editor(fs, loadOptions))
    {
        // Use the editor instance to edit and save documents
    }
}

See Also


Editor(string, ILoadOptions)

Initializes new Editor instance with specified input document (as a full file path) with its load options.

public Editor(string filePath, ILoadOptions loadOptions)
Parameter Type Description
filePath String Full path to the file. Should not be null, empty or contain only whitespaces. Should be valid, and file should exist.
loadOptions ILoadOptions Document load options. May be null.

Exceptions

exception condition
ArgumentException Thrown when the file path is invalid.
FileNotFoundException Thrown when the file does not exist.

Remarks

Learn more

Examples

string filePath = "input.docx";
ILoadOptions loadOptions = new WordProcessingLoadOptions();
using (Editor editor = new Editor(filePath, loadOptions))
{
    // Use the editor instance to edit and save documents
}

See Also


Editor(string)

Initializes new Editor instance with specified input document (as a full file path) and Editor settings

public Editor(string filePath)
Parameter Type Description
filePath String Full path to the file. Should not be NULL. Should be valid, and file should exist.

See Also