PdfConverterGetPdfDocumentObjectFromHtmlStringAsync Method |
Converts the specified HTML string asynchronously and returns a Document object that can be modified and saved.
Namespace: ExpertPdf.HtmlToPdfAssembly: ephtmltopdf (in ephtmltopdf.dll) Version: 22.0.0
Syntaxpublic Task<Document> GetPdfDocumentObjectFromHtmlStringAsync(
string htmlString,
string urlBase,
CancellationToken cancellationToken = default
)
Public Function GetPdfDocumentObjectFromHtmlStringAsync (
htmlString As String,
urlBase As String,
Optional cancellationToken As CancellationToken = Nothing
) As Task(Of Document)
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
TaskDocumentA 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 Also