from Html String
open fun fromHtmlString(@NonNull context: Context, @NonNull htmlString: String, @Nullable baseUrl: String): HtmlToPdfConverter
Creates HTML-to-PDF converter from HTML string.
You can provide any resources (images, stylesheets, JavaScript etc.) required by the HTML by setting custom ResourceInterceptor via setResourceInterceptor.
Configured baseUrl
will be used as the base URL for resolving any relative URLs for any resources. Note that the ResourceInterceptor set via setResourceInterceptor is called for relative URLs only when the baseUrl
is set.
Parameters
context
The context to use.
html String
String with HTML content to convert to PDF.
base Url
Base url to use to load relative URLs in the HTML. May be null
.