Click or drag to resize

PdfConverterGetPdfBytesFromHtmlStringAsync(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,
	CancellationToken cancellationToken = default
)

Parameters

htmlString  String
The HTML string to be converted to PDF.
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