DocumentConverterConvertTo(Stream, DocumentFormat, NullableDocumentEngine) Method

Converts the document file to another format with the specified output stream and format. For multi-page output conversions, only the first page will be saved to the stream as it would be useless to save all pages to the same stream.

Definition

Namespace: GleamTech.DocumentUltimate
Assembly: GleamTech.DocumentUltimate (in GleamTech.DocumentUltimate.dll) Version: 7.1.5
C#
public DocumentConverterResult ConvertTo(
	Stream outputStream,
	DocumentFormat outputFormat,
	DocumentEngine? engine = null
)

Parameters

outputStream  Stream
The stream to write the converted document file.
outputFormat  DocumentFormat
The target format to convert the document file to.
engine  NullableDocumentEngine  (Optional)
The document engine to force. If not specified, the best document engine will be chosen automatically according to the input and output formats.

Return Value

DocumentConverterResult
A DocumentConverterResult object that contains the result of the document conversion such as output file paths.

Example

Converting to an output stream:

C#
var documentConverter = new DocumentConverter(@"c:\SomeFolder\InputFile.docx");

// Convert "InputFile.docx" to Pdf written to outputStream
using (outputStream)
    documentConverter.ConvertTo(outputStream, DocumentFormat.Pdf);

See Also