HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML Forums › Technical questions / Troubleshooting › Images and other resources via HTTPS are no longer showing
- This topic has 1 reply, 2 voices, and was last updated Oct 27, 2026
20:51:10 byPD4ML.
-
AuthorPosts
-
December 24, 2025 at 19:30#40311
Hi, I have a coldfusion application that uses pd4ml v4 to convert html to pdf. The images in the html page are referenced via https protocol in the “src” attribute of the
tag.
The conversion have been working fine for YEARS. It suddenly stopped working. html page would convert but all the images are missing.
I’ve encountered it in the past a few times, and normally I would just replace the jar file with an updated version and it would start working again.
On the recent failure, I can’t seem to make it work again unless I replace all the “https” with “http”.
When using the command line with the exact same java runtime as coldfusion, it works just fine. But when instantiating the class from coldfusion directly the https images are missing.Here’s my simplified code:
<cfscript> pd4 = createObject("java", "com.pd4ml.PD4ML"); Constants = createObject("java", "com.pd4ml.Constants"); // Now proceed as you already do htmlPath = "c:\temp\report_pdf.htm"; fis = createObject("java", "java.io.FileInputStream").init(htmlPath); pd4.readHTML(fis); pdfPath = "C:\home\a3db.net\wwwroot\beta5\tests\out\outtest0119.pdf"; fos = createObject("java", "java.io.FileOutputStream").init(pdfPath); pd4.writePDF(fos); fis.close(); fos.close(); writeOutput("Wrote PDF: " & pdfPath); </cfscript>The “report_pdf.htm” simply have:
<div><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/2/2f/Google_2015_logo.svg/250px-Google_2015_logo.svg.png" border="1" width="672" /></div>But you can replace the src with any https image anywhere. This is just an example.
I understand that technically pd4ml doesn’t support https. What’s the reason for that?
I saw something about creating an resource loader class, but it seems too complicated to me.Please help.
Thanks!
October 27, 2026 at 20:51#41931Hello sivanleoni,
Just to clear up one point: PD4ML does support https. Images, CSS and other resources are loaded over https by the library itself, and it doesn't validate the server certificate. You don't need a custom resource loader for this. So the cause is almost certainly in the runtime environment, not in PD4ML.
You said it works from the command line with the same JRE, but not from ColdFusion. That points to something inside the ColdFusion process. Typical causes are:
– ColdFusion has its own security settings or TLS provider jars (for example an old or bundled JSSE or Bouncy Castle) that differ from the plain JRE.
– The image server has dropped older TLS versions or cipher suites, and the Java inside ColdFusion can't negotiate a new enough one. This usually happens after the server's certificate or TLS configuration is renewed, which would explain the sudden failure after years. Updating ColdFusion's bundled Java (or pointing ColdFusion at a current JDK) normally fixes it.To see the actual error, enable PD4ML logging before readHTML():
<cfscript> pd4 = createObject("java", "com.pd4ml.PD4ML"); Constants = createObject("java", "com.pd4ml.Constants"); pd4.setLogLevel(Constants.LOG_VERBOSE); // ... readHTML / writePDF as before </cfscript>The messages go to the console, which for ColdFusion is its output log (coldfusion-out.log). Please post the lines mentioning the failed https image. They will name the exact cause, for example a handshake failure, "protocol_version", "Could not generate DH keypair" (the message PD4ML prints when the Java libraries are too old), or a timeout.
Two quick checks:
1. Runjava.lang.System.getProperty("java.version")from inside ColdFusion, and compare it with the CLI JRE. The "same runtime" may not be the one ColdFusion actually uses.
2. Check whether your jar is the latest build available to you. Your maintenance period ended on 2026-03-23, so newer releases may not be covered by it. Please contact us about renewal if you need one.As a workaround, if you can't fix the TLS setup right away, keep the images on http or embed them as data: URIs.
Please send the PD4ML version (the jar file name is enough) and the log output, and we'll look further.
Best regards,
PD4ML Support -
AuthorPosts
You must be logged in to reply to this topic.
