Processor.To

Processor To method. Specifies output file for the processor.

To(string, SaveOptions)

Specifies output file for the processor.

public Processor To(string output, SaveOptions saveOptions = null)
ParameterTypeDescription
outputStringOutput file name.
saveOptionsSaveOptionsOptional 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 convert DOCX document to PDF using Fluent API.

Converter.Create()
    .From(MyDir + "Simple.docx")
    .To(ArtifactsDir + "Converter.ConvertToPdf.pdf")
    .Execute();

See Also


To(string, SaveFormat)

Specifies output file for the processor.

public Processor To(string output, SaveFormat saveFormat)
ParameterTypeDescription
outputStringOutput file name.
saveFormatSaveFormatSave 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’.

See Also


To(Stream, SaveOptions)

Specifies output stream for the processor.

public Processor To(Stream output, SaveOptions saveOptions)
ParameterTypeDescription
outputStreamOutput stream.
saveOptionsSaveOptionsSave 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.

See Also


To(Stream, SaveFormat)

Specifies output stream for the processor.

public Processor To(Stream output, SaveFormat saveFormat)
ParameterTypeDescription
outputStreamOutput stream.
saveFormatSaveFormatSave 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.

See Also


To(List<Stream>, SaveOptions)

Specifies output Document streams list.

public Processor To(List<Stream> output, SaveOptions saveOptions)
ParameterTypeDescription
outputList`1Output document streams list.
saveOptionsSaveOptionsSave 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.

Examples

Shows how to split document into pages using fluent Api.

SplitterContext context = new SplitterContext();
context.SplitOptions.SplitCriteria = SplitCriteria.Page;

List<Stream> pages = new List<Stream>();
Splitter.Create(context)
    .From(MyDir + "TestSpliter.docx")
    .To(pages, SaveFormat.Docx)
    .Execute();

See Also


To(List<Stream>, SaveFormat)

Specifies output Document streams list.

public Processor To(List<Stream> output, SaveFormat saveFormat)
ParameterTypeDescription
outputList`1Output document streams list.
saveFormatSaveFormatSave 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