Click or drag to resize

PdfConverterGetPdfDocumentObjectFromHtmlStringAsync Method

Converts the specified HTML string asynchronously and returns a Document object that can be modified and saved.

Namespace: ExpertPdf.HtmlToPdf
Assembly: ephtmltopdf (in ephtmltopdf.dll) Version: 22.0.0
Syntax
public Task<Document> GetPdfDocumentObjectFromHtmlStringAsync(
	string htmlString,
	string urlBase,
	CancellationToken cancellationToken = default
)

Parameters

htmlString  String
The HTML string to be converted to PDF.
urlBase  String
The full URL of the page from where this string was taken, used to resolve the images and CSS files referenced by a relative URL in the HTML string.
cancellationToken  CancellationToken  (Optional)
A token that cancels the wait for the conversion.

Return Value

TaskDocument
A task whose result is the Document object. The Document object must be closed after save to release the system resources used during conversion.
Remarks
See GetPdfBytesFromUrlAsync(String, CancellationToken) for how the conversion runs and how cancellation works. The document of a conversion that completes after the task was canceled is closed.
See Also