 |
HtmlToImageConvertHtmlString(String) Method |
Converts the specified HTML string to an image in
ImageFormat (PNG by default).
Namespace: SelectPdf.UniversalAssembly: SelectPdf.Universal (in SelectPdf.Universal.dll) Version: 26.4
Syntaxpublic byte[] ConvertHtmlString(
string htmlString
)
Public Function ConvertHtmlString (
htmlString As String
) As Byte()
Parameters
- htmlString String
- The HTML markup to render.
Return Value
ByteThe rendered image, encoded in
ImageFormat.
Exceptions| Exception | Condition |
|---|
| HtmlToPdfException | Thrown when htmlString is null, or the conversion fails. |
ExampleSelectPdf.Universal.HtmlToImage converter = new SelectPdf.Universal.HtmlToImage();
byte[] png = converter.ConvertHtmlString("<h1>Hello</h1>");Dim converter As New SelectPdf.Universal.HtmlToImage()
Dim png As Byte() = converter.ConvertHtmlString("<h1>Hello</h1>")
See Also