I’m observing terrible conversion times when attempting to convert even the simplest HTML document to PDF (AposePDF.Java 20.5).
I have narrowed down a number of issues:
- When attempting to download images from external resources, AsposePDF.Java does not use the configured
javax.net.ssl.trustStore
truststore - I can see with-Djavax.net.debug=all
enabled that the default jsse truststore is being loaded, and not the one specified by the system property. If you are using slf4j, you also need to use jul-to-slf4j bridge, otherwise the messages about no trusted path are lost - If prior to the conversion, I manually use
new URL("https://server.local/img.png").openConnection()
then the configured truststore is used, so AsposePDF is not respecting the configured truststore. - AposePDF.java also explicitly requires
http.proxyHost
andhttp.proxyPort
system properties set when running on a corp network, if they are not set then I see nearly 90 seconds hang up time during conversion. This is not related to the poor performance for the first load, as the second (and subsequent) conversion is around 90 seconds, which i presume is some url connection timeout issue. You can sethttp.proxyHost
or port to anything and it will reduce the second+ conversion to around about 1 second.
So is there any specific guidance on using a custom truststore for external resource downloads, how to configure proxy, and why the following (when pulling resources from a server not trusted by the truststore) takes so long to convert if http.proxyHost is not set.
<html>
<body>
<h1>Title</h1>
<img src="https://server.local/img.png"
width="100px"
height="100px">
</body>
</html>