HtmlToPdfConverterConvertHtmlToFileAsync Method

Asynchronously converts a HTML string to PDF using a base URL to resolve external resources and writes the rendered PDF document into a file. A new instance of HtmlToPdfConverter must be created for each call to this method

Definition

Namespace: Winnovative.Pdf.Next
Assembly: Winnovative.Pdf.Next (in Winnovative.Pdf.Next.dll) Version: 20.0.0
C#
public Task ConvertHtmlToFileAsync(
	string htmlString,
	string baseUrl,
	string outFile,
	CancellationToken ct = default
)

Parameters

htmlString  String
The HTML string to convert to PDF
baseUrl  String
The base URL used to determine the full URL of the external resources like images, CSS, JavaScript and Web Font files referenced by relative URLs in HTML. It can be null if it is not needed
outFile  String
The full path of the file where to write the rendered PDF document
ct  CancellationToken  (Optional)
A cancellation token that can be used to cancel the asynchronous operation. When cancellation is requested the task returned by this method will complete by throwing OperationCanceledException as soon as possible.

Return Value

Task
A task that represents the asynchronous operation

See Also