fromHTMLString

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. In this case, you'll need to provide base URI for resolving relative URIs of these resources via fromHTMLString.

Parameters

context

The context to use.

htmlString

String with HTML content to convert to PDF.


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.

htmlString

String with HTML content to convert to PDF.

baseUrl

Base url to use to load relative URLs in the HTML. May be null.