Asynchronous Font Loading in the HTML2PDF Module

Q: I am using asynchronous font loading in my HTML page and there is missing text in my output PDF.
Ex:

A: In these cases the HTML2PDF module most likely starts printing before the font has been downloaded. You need to tell the module to wait until the download has completed before printing. The WebPageSettings class has SetJavaScriptDelay to wait until the fonts are loaded. This will delay printing until the network requests are complete or until the delay value has expired.

1 Like