## To(*string*) {#to_4}

Specifies output file for the processor.

```csharp
public Processor To(string output)
```

| Parameter | Type | Description |
| --- | --- | --- |
| output | String | Output file name. |

### Return Value

Returns processor with specified output file.

## Remarks

If the output consists of multiple files, the specified output file name is used to generate the file name for each part following the rule: 'outputFile_partIndex.extension'.

### See Also

* class [Processor](../)
* namespace [Aspose.Words.LowCode](../../../aspose.words.lowcode/)
* assembly [Aspose.Words](../../../)

---

## To(*string, [SaveOptions](../../../aspose.words.saving/saveoptions/)*) {#to_6}

Specifies output file for the processor.

```csharp
public Processor To(string output, SaveOptions saveOptions)
```

| Parameter | Type | Description |
| --- | --- | --- |
| output | String | Output file name. |
| saveOptions | SaveOptions | Optional save options. If not specified, save format is determined by the file extension. |

### Return Value

Returns processor with specified output file.

## Remarks

If the output consists of multiple files, the specified output file name is used to generate the file name for each part following the rule: 'outputFile_partIndex.extension'.

## Examples

Shows how to merge documents into a single output document using context.

```csharp
//There is a several ways to merge documents:
string inputDoc1 = MyDir + "Big document.docx";
string inputDoc2 = MyDir + "Tables.docx";

MergerContext context = new MergerContext() { MergeFormatMode = MergeFormatMode.KeepSourceFormatting };

Merger.Create(context)
    .From(inputDoc1)
    .From(inputDoc2)
    .To(ArtifactsDir + "LowCode.MergeContextDocuments.1.docx")
    .Execute();

LoadOptions firstLoadOptions = new LoadOptions() { IgnoreOleData = true };
LoadOptions secondLoadOptions = new LoadOptions() { IgnoreOleData = false };
MergerContext contextLoadOptions = new MergerContext() { MergeFormatMode = MergeFormatMode.KeepSourceFormatting };
Merger.Create(contextLoadOptions)
    .From(inputDoc1, firstLoadOptions)
    .From(inputDoc2, secondLoadOptions)
    .To(ArtifactsDir + "LowCode.MergeContextDocuments.2.docx", SaveFormat.Docx)
    .Execute();

OoxmlSaveOptions saveOptions = new OoxmlSaveOptions { Password = "Aspose.Words" };
MergerContext contextSaveOptions = new MergerContext() { MergeFormatMode = MergeFormatMode.KeepSourceFormatting };
Merger.Create(contextSaveOptions)
    .From(inputDoc1)
    .From(inputDoc2)
    .To(ArtifactsDir + "LowCode.MergeContextDocuments.3.docx", saveOptions)
    .Execute();
```

Shows how to convert documents with a single line of code using context.

```csharp
string doc = MyDir + "Big document.docx";

Converter.Create(new ConverterContext())
    .From(doc)
    .To(ArtifactsDir + "LowCode.ConvertContext.1.pdf")
    .Execute();

Converter.Create(new ConverterContext())
    .From(doc)
    .To(ArtifactsDir + "LowCode.ConvertContext.2.pdf", SaveFormat.Rtf)
    .Execute();

OoxmlSaveOptions saveOptions = new OoxmlSaveOptions { Password = "Aspose.Words" };
LoadOptions loadOptions = new LoadOptions() { IgnoreOleData = true };
Converter.Create(new ConverterContext())
    .From(doc, loadOptions)
    .To(ArtifactsDir + "LowCode.ConvertContext.3.docx", saveOptions)
    .Execute();

Converter.Create(new ConverterContext())
    .From(doc)
    .To(ArtifactsDir + "LowCode.ConvertContext.4.png", new ImageSaveOptions(SaveFormat.Png))
    .Execute();
```

### See Also

* class [SaveOptions](../../../aspose.words.saving/saveoptions/)
* class [Processor](../)
* namespace [Aspose.Words.LowCode](../../../aspose.words.lowcode/)
* assembly [Aspose.Words](../../../)

---

## To(*string, [SaveFormat](../../../aspose.words/saveformat/)*) {#to_5}

Specifies output file for the processor.

```csharp
public Processor To(string output, SaveFormat saveFormat)
```

| Parameter | Type | Description |
| --- | --- | --- |
| output | String | Output file name. |
| saveFormat | SaveFormat | Save format. If not specified, save format is determined by the file extension. |

### Return Value

Returns processor with specified output file.

## Remarks

If the output consists of multiple files, the specified output file name is used to generate the file name for each part following the rule: 'outputFile_partIndex.extension'.

## Examples

Shows how to merge documents into a single output document using context.

```csharp
//There is a several ways to merge documents:
string inputDoc1 = MyDir + "Big document.docx";
string inputDoc2 = MyDir + "Tables.docx";

MergerContext context = new MergerContext() { MergeFormatMode = MergeFormatMode.KeepSourceFormatting };

Merger.Create(context)
    .From(inputDoc1)
    .From(inputDoc2)
    .To(ArtifactsDir + "LowCode.MergeContextDocuments.1.docx")
    .Execute();

LoadOptions firstLoadOptions = new LoadOptions() { IgnoreOleData = true };
LoadOptions secondLoadOptions = new LoadOptions() { IgnoreOleData = false };
MergerContext contextLoadOptions = new MergerContext() { MergeFormatMode = MergeFormatMode.KeepSourceFormatting };
Merger.Create(contextLoadOptions)
    .From(inputDoc1, firstLoadOptions)
    .From(inputDoc2, secondLoadOptions)
    .To(ArtifactsDir + "LowCode.MergeContextDocuments.2.docx", SaveFormat.Docx)
    .Execute();

OoxmlSaveOptions saveOptions = new OoxmlSaveOptions { Password = "Aspose.Words" };
MergerContext contextSaveOptions = new MergerContext() { MergeFormatMode = MergeFormatMode.KeepSourceFormatting };
Merger.Create(contextSaveOptions)
    .From(inputDoc1)
    .From(inputDoc2)
    .To(ArtifactsDir + "LowCode.MergeContextDocuments.3.docx", saveOptions)
    .Execute();
```

### See Also

* enum [SaveFormat](../../../aspose.words/saveformat/)
* class [Processor](../)
* namespace [Aspose.Words.LowCode](../../../aspose.words.lowcode/)
* assembly [Aspose.Words](../../../)

---

## To(*Stream, [SaveOptions](../../../aspose.words.saving/saveoptions/)*) {#to_3}

Specifies output stream for the processor.

```csharp
public Processor To(Stream output, SaveOptions saveOptions)
```

| Parameter | Type | Description |
| --- | --- | --- |
| output | Stream | Output stream. |
| saveOptions | SaveOptions | Save options. |

### Return Value

Returns processor with specified output stream.

## Remarks

If the output consists of multiple files, only the first part will be saved to the specified stream.

## Examples

Shows how to merge documents from stream into a single output document using context.

```csharp
//There is a several ways to merge documents:
string inputDoc1 = MyDir + "Big document.docx";
string inputDoc2 = MyDir + "Tables.docx";

using (FileStream firstStreamIn = new FileStream(MyDir + "Big document.docx", FileMode.Open, FileAccess.Read))
{
    using (FileStream secondStreamIn = new FileStream(MyDir + "Tables.docx", FileMode.Open, FileAccess.Read))
    {
        OoxmlSaveOptions saveOptions = new OoxmlSaveOptions { Password = "Aspose.Words" };
        using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.MergeStreamContextDocuments.1.docx", FileMode.Create, FileAccess.ReadWrite))
        {
            MergerContext context = new MergerContext() {MergeFormatMode = MergeFormatMode.KeepSourceFormatting};
            Merger.Create(context).From(firstStreamIn).From(secondStreamIn).To(streamOut, saveOptions).Execute();
        }

        LoadOptions firstLoadOptions = new LoadOptions() { IgnoreOleData = true };
        LoadOptions secondLoadOptions = new LoadOptions() { IgnoreOleData = false };
        using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.MergeStreamContextDocuments.2.docx", FileMode.Create, FileAccess.ReadWrite))
        {
            MergerContext context = new MergerContext() {MergeFormatMode = MergeFormatMode.KeepSourceFormatting};
            Merger.Create(context).From(firstStreamIn, firstLoadOptions).From(secondStreamIn, secondLoadOptions).To(streamOut, SaveFormat.Docx).Execute();
        }
    }
}
```

Shows how to convert documents from a stream with a single line of code using context.

```csharp
string doc = MyDir + "Document.docx";
using (FileStream streamIn = new FileStream(MyDir + "Big document.docx", FileMode.Open, FileAccess.Read))
{
    using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.ConvertContextStream.1.docx", FileMode.Create, FileAccess.ReadWrite))
        Converter.Create(new ConverterContext())
            .From(streamIn)
            .To(streamOut, SaveFormat.Rtf)
            .Execute();

    OoxmlSaveOptions saveOptions = new OoxmlSaveOptions { Password = "Aspose.Words" };
    LoadOptions loadOptions = new LoadOptions() { IgnoreOleData = true };
    using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.ConvertContextStream.2.docx", FileMode.Create, FileAccess.ReadWrite))
        Converter.Create(new ConverterContext())
            .From(streamIn, loadOptions)
            .To(streamOut, saveOptions)
            .Execute();

    List<Stream> pages = new List<Stream>();
    Converter.Create(new ConverterContext())
        .From(doc)
        .To(pages, new ImageSaveOptions(SaveFormat.Png))
        .Execute();
}
```

### See Also

* class [SaveOptions](../../../aspose.words.saving/saveoptions/)
* class [Processor](../)
* namespace [Aspose.Words.LowCode](../../../aspose.words.lowcode/)
* assembly [Aspose.Words](../../../)

---

## To(*Stream, [SaveFormat](../../../aspose.words/saveformat/)*) {#to_2}

Specifies output stream for the processor.

```csharp
public Processor To(Stream output, SaveFormat saveFormat)
```

| Parameter | Type | Description |
| --- | --- | --- |
| output | Stream | Output stream. |
| saveFormat | SaveFormat | Save format. |

### Return Value

Returns processor with specified output stream.

## Remarks

If the output consists of multiple files, only the first part will be saved to the specified stream.

## Examples

Shows how to merge documents from stream into a single output document using context.

```csharp
//There is a several ways to merge documents:
string inputDoc1 = MyDir + "Big document.docx";
string inputDoc2 = MyDir + "Tables.docx";

using (FileStream firstStreamIn = new FileStream(MyDir + "Big document.docx", FileMode.Open, FileAccess.Read))
{
    using (FileStream secondStreamIn = new FileStream(MyDir + "Tables.docx", FileMode.Open, FileAccess.Read))
    {
        OoxmlSaveOptions saveOptions = new OoxmlSaveOptions { Password = "Aspose.Words" };
        using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.MergeStreamContextDocuments.1.docx", FileMode.Create, FileAccess.ReadWrite))
        {
            MergerContext context = new MergerContext() {MergeFormatMode = MergeFormatMode.KeepSourceFormatting};
            Merger.Create(context).From(firstStreamIn).From(secondStreamIn).To(streamOut, saveOptions).Execute();
        }

        LoadOptions firstLoadOptions = new LoadOptions() { IgnoreOleData = true };
        LoadOptions secondLoadOptions = new LoadOptions() { IgnoreOleData = false };
        using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.MergeStreamContextDocuments.2.docx", FileMode.Create, FileAccess.ReadWrite))
        {
            MergerContext context = new MergerContext() {MergeFormatMode = MergeFormatMode.KeepSourceFormatting};
            Merger.Create(context).From(firstStreamIn, firstLoadOptions).From(secondStreamIn, secondLoadOptions).To(streamOut, SaveFormat.Docx).Execute();
        }
    }
}
```

Shows how to convert documents from a stream with a single line of code using context.

```csharp
string doc = MyDir + "Document.docx";
using (FileStream streamIn = new FileStream(MyDir + "Big document.docx", FileMode.Open, FileAccess.Read))
{
    using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.ConvertContextStream.1.docx", FileMode.Create, FileAccess.ReadWrite))
        Converter.Create(new ConverterContext())
            .From(streamIn)
            .To(streamOut, SaveFormat.Rtf)
            .Execute();

    OoxmlSaveOptions saveOptions = new OoxmlSaveOptions { Password = "Aspose.Words" };
    LoadOptions loadOptions = new LoadOptions() { IgnoreOleData = true };
    using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.ConvertContextStream.2.docx", FileMode.Create, FileAccess.ReadWrite))
        Converter.Create(new ConverterContext())
            .From(streamIn, loadOptions)
            .To(streamOut, saveOptions)
            .Execute();

    List<Stream> pages = new List<Stream>();
    Converter.Create(new ConverterContext())
        .From(doc)
        .To(pages, new ImageSaveOptions(SaveFormat.Png))
        .Execute();
}
```

### See Also

* enum [SaveFormat](../../../aspose.words/saveformat/)
* class [Processor](../)
* namespace [Aspose.Words.LowCode](../../../aspose.words.lowcode/)
* assembly [Aspose.Words](../../../)

---

## To(*List&lt;Stream&gt;, [SaveOptions](../../../aspose.words.saving/saveoptions/)*) {#to_1}

Specifies output Document streams list.

```csharp
public Processor To(List<Stream> output, SaveOptions saveOptions)
```

| Parameter | Type | Description |
| --- | --- | --- |
| output | List`1 | Output document streams list. |
| saveOptions | SaveOptions | Save options. |

### Return Value

Returns processor with specified output document streams list.

## Remarks

If the output consists of multiple files (such as images or split document parts), a stream for each part is added to the specified list. If the output is a single file, only one stream is added to the list. It is the end user's responsibility to dispose of the created streams.

### See Also

* class [SaveOptions](../../../aspose.words.saving/saveoptions/)
* class [Processor](../)
* namespace [Aspose.Words.LowCode](../../../aspose.words.lowcode/)
* assembly [Aspose.Words](../../../)

---

## To(*List&lt;Stream&gt;, [SaveFormat](../../../aspose.words/saveformat/)*) {#to}

Specifies output Document streams list.

```csharp
public Processor To(List<Stream> output, SaveFormat saveFormat)
```

| Parameter | Type | Description |
| --- | --- | --- |
| output | List`1 | Output document streams list. |
| saveFormat | SaveFormat | Save format. |

### Return Value

Returns processor with specified output document streams list.

## Remarks

If the output consists of multiple files (such as images or split document parts), a stream for each part is added to the specified list. If the output is a single file, only one stream is added to the list. It is the end user's responsibility to dispose of the created streams.

### See Also

* enum [SaveFormat](../../../aspose.words/saveformat/)
* class [Processor](../)
* namespace [Aspose.Words.LowCode](../../../aspose.words.lowcode/)
* assembly [Aspose.Words](../../../)
