ConverterAsync.ConvertHTMLAsync

ConverterAsync.ConvertHTMLAsync method

ConvertHTMLAsync(HtmlSource, SaveOptions, ICreateStreamProvider, CancellationToken)

Converts source to the streams output creates, one per part.

public static Task<ConversionResult> ConvertHTMLAsync(HtmlSource source, SaveOptions options, ICreateStreamProvider output, CancellationToken cancellationToken = default)
ParameterTypeDescription
sourceHtmlSourceThe HTML source.
optionsSaveOptionsPDF or image options.
outputICreateStreamProviderThe stream provider.
cancellationTokenCancellationTokenCancels the conversion at its next checkpoint.

Return Value

Task<ConversionResult>: The conversion result.

See Also


ConvertHTMLAsync(HtmlSource, SaveOptions, Stream, CancellationToken)

Converts source to output, left open.

public static Task<ConversionResult> ConvertHTMLAsync(HtmlSource source, SaveOptions options, Stream output, CancellationToken cancellationToken = default)
ParameterTypeDescription
sourceHtmlSourceThe HTML source.
optionsSaveOptionsPDF or image options.
outputStreamA writable stream.
cancellationTokenCancellationTokenCancels the conversion at its next checkpoint.

Return Value

Task<ConversionResult>: The conversion result.

See Also


ConvertHTMLAsync(HtmlSource, SaveOptions, string, CancellationToken)

Converts source to the file outputPath.

public static Task<ConversionResult> ConvertHTMLAsync(HtmlSource source, SaveOptions options, string outputPath, CancellationToken cancellationToken = default)
ParameterTypeDescription
sourceHtmlSourceThe HTML source.
optionsSaveOptionsPDF or image options.
outputPathstringThe output file; replaced only when the conversion succeeds.
cancellationTokenCancellationTokenCancels the conversion at its next checkpoint.

Return Value

Task<ConversionResult>: The conversion result.

See Also


ConvertHTMLAsync(string, SaveOptions, string, CancellationToken)

Converts the HTML file inputPath to the file outputPath.

public static Task<ConversionResult> ConvertHTMLAsync(string inputPath, SaveOptions options, string outputPath, CancellationToken cancellationToken = default)
ParameterTypeDescription
inputPathstringThe input file; its directory is an allowed file root.
optionsSaveOptionsPDF or image options.
outputPathstringThe output file.
cancellationTokenCancellationTokenCancels the conversion at its next checkpoint.

Return Value

Task<ConversionResult>: The conversion result.

See Also


ConvertHTMLAsync(Stream, string, SaveOptions, Stream, CancellationToken)

Converts the HTML bytes of input to output; both stay open.

public static Task<ConversionResult> ConvertHTMLAsync(Stream input, string baseUri, SaveOptions options, Stream output, CancellationToken cancellationToken = default)
ParameterTypeDescription
inputStreamThe input, read on the pool thread from its current position.
baseUristringAn absolute http(s) or file URI, or about:blank.
optionsSaveOptionsPDF or image options.
outputStreamA writable stream.
cancellationTokenCancellationTokenCancels the conversion at its next checkpoint.

Return Value

Task<ConversionResult>: The conversion result.

See Also


ConvertHTMLAsync(Stream, string, SaveOptions, string, CancellationToken)

Converts the HTML bytes of input to the file outputPath.

public static Task<ConversionResult> ConvertHTMLAsync(Stream input, string baseUri, SaveOptions options, string outputPath, CancellationToken cancellationToken = default)
ParameterTypeDescription
inputStreamThe input, read on the pool thread from its current position and left open.
baseUristringAn absolute http(s) or file URI, or about:blank.
optionsSaveOptionsPDF or image options.
outputPathstringThe output file.
cancellationTokenCancellationTokenCancels the conversion at its next checkpoint.

Return Value

Task<ConversionResult>: The conversion result.

See Also


ConvertHTMLAsync(string, string, SaveOptions, Stream, CancellationToken)

Converts the markup html to output, left open.

public static Task<ConversionResult> ConvertHTMLAsync(string html, string baseUri, SaveOptions options, Stream output, CancellationToken cancellationToken = default)
ParameterTypeDescription
htmlstringThe markup.
baseUristringAn absolute http(s) or file URI, or about:blank.
optionsSaveOptionsPDF or image options.
outputStreamA writable stream.
cancellationTokenCancellationTokenCancels the conversion at its next checkpoint.

Return Value

Task<ConversionResult>: The conversion result.

See Also


ConvertHTMLAsync(string, string, SaveOptions, string, CancellationToken)

Converts the markup html to the file outputPath.

public static Task<ConversionResult> ConvertHTMLAsync(string html, string baseUri, SaveOptions options, string outputPath, CancellationToken cancellationToken = default)
ParameterTypeDescription
htmlstringThe markup.
baseUristringAn absolute http(s) or file URI, or about:blank.
optionsSaveOptionsPDF or image options.
outputPathstringThe output file.
cancellationTokenCancellationTokenCancels the conversion at its next checkpoint.

Return Value

Task<ConversionResult>: The conversion result.

See Also