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.Anywhere.HtmlToPdfAssembly: ExpertPdf.Anywhere (in ExpertPdf.Anywhere.dll) Version: 22.0
Syntaxpublic Task<byte[]> GetPdfBytesFromHtmlStringAsync(
string htmlString,
string urlBase,
CancellationToken cancellationToken = default
)
Public Function GetPdfBytesFromHtmlStringAsync (
htmlString As String,
urlBase As String,
Optional cancellationToken As CancellationToken = Nothing
) As Task(Of Byte())
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 conversion.
Return Value
TaskByteA task whose result is the binary representation of the PDF document.
Remarks
See Also