Click or drag to resize

PdfConverterGetPdfBytesFromHtmlStringAsync(String, String, CancellationToken) Method

Converts the specified HTML string into a PDF document asynchronously and returns the rendered PDF document as an array of bytes.

Namespace: ExpertPdf.HtmlToPdf
Assembly: ephtmltopdf (in ephtmltopdf.dll) Version: 22.0.0
Syntax
public Task<byte[]> GetPdfBytesFromHtmlStringAsync(
	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

TaskByte
A task whose result is the binary representation of the PDF document.
Remarks
See GetPdfBytesFromUrlAsync(String, CancellationToken) for how the conversion runs and how cancellation works.
See Also