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.
Namespace: GleamTech.DocumentUltimateAssembly: GleamTech.DocumentUltimate (in GleamTech.DocumentUltimate.dll) Version: 7.1.5
public DocumentConverterResult ConvertTo(
Stream outputStream,
DocumentFormat outputFormat,
DocumentEngine? engine = null
)
Public Function ConvertTo (
outputStream As Stream,
outputFormat As DocumentFormat,
Optional engine As DocumentEngine? = Nothing
) As DocumentConverterResult
- 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.
DocumentConverterResultA
DocumentConverterResult object that contains the result of the document conversion such as output file paths.
Converting to an output stream:
var documentConverter = new DocumentConverter(@"c:\SomeFolder\InputFile.docx");
// Convert "InputFile.docx" to Pdf written to outputStream
using (outputStream)
documentConverter.ConvertTo(outputStream, DocumentFormat.Pdf);
Dim documentConverter As New DocumentConverter("c:\SomeFolder\InputFile.docx")
' Convert "InputFile.docx" to Pdf written to outputStream
Using outputStream
documentConverter.ConvertTo(outputStream, DocumentFormat.Pdf)
End Using