Html To Pdf Converter
class HtmlToPdfConverter
Converts HTML to PDF document.
Note: HTML-to-PDF conversion internally relies on the system WebView implementation. This means that there are certain aspects of this conversion process that PSPDFKit can't support. This includes, for example, any possible WebView bugs.
Note: JavaScript execution is enabled by default. This could cause security and performance issues. Please review your JavaScripts carefully. If you wish to disable JavaScript execution while performing the HTML conversion, set setJavaScriptEnabled to false
.
Note: This API requires HTML-to-PDF conversion feature in your license.
Types
Link copied to clipboard
interface PageLoadingProgressListener
Listener for page loading progress updates used when loading HTML page in .
Functions
Link copied to clipboard
Performs HTML-to-PDF conversion to a temporary file in application's cache directory.
Performs HTML-to-PDF conversion to specified file.
Link copied to clipboard
Checks whether PSPDFKit can perform HTML-to-PDF conversion on this device.
Link copied to clipboard
open fun fromHTMLString(@NonNull context: Context, @NonNull htmlString: String, @Nullable baseUrl: String): HtmlToPdfConverter
Creates HTML-to-PDF converter from HTML string.
Link copied to clipboard
Enables or disables JavaScript processing.
Link copied to clipboard
open fun setPageLoadingProgressListener(@Nullable pageLoadingProgressListener: HtmlToPdfConverter.PageLoadingProgressListener): HtmlToPdfConverter
Sets listener that will be called whenever page loading progress changes.
Link copied to clipboard
open fun setResourceInterceptor(@Nullable resourceInterceptor: ResourceInterceptor): HtmlToPdfConverter
Sets resource interceptor that will be called whenever the HTML converter wants to load any page resource (image, stylesheet, JavaScript etc.).