HTML to PDF / DOCX / RTF Java converter library Forums PD4ML Forums Technical questions / Troubleshooting Images and other resources via HTTPS are no longer showing

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #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:

    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!

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.