DocumentConverterConvertTo(Stream, OutputOptions, NullableDocumentEngine) Method

Converts the document file to another format with the specified output stream and options. 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: 6.9.6
C#
public DocumentConverterResult ConvertTo(
	Stream outputStream,
	OutputOptions outputOptions,
	DocumentEngine? engine = null
)

Parameters

outputStream  Stream
The stream to write the converted document file.
outputOptions  OutputOptions
The output options which contains format and other options for the converted file.
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