After updating CF2023 to update 13, htmltopdf stop...
# cfml-general
c
After updating CF2023 to update 13, htmltopdf stopped working. I implemented the workaround as documented on the update 13 release note. The log shows that the PDFgServlet is registered, but now in the log all I see is "Error occurred while generating PDF." when I try to generate a pdf. I'm on Win Server, IIS and CF2023. I've included the code that I used to test as well.
cfhtmltopdf(
source = "https://www.google.com/", destination = "sample.pdf", overwrite = true ); May 2, 2025 113436 AM Information [ajp-nio-127.0.0.1-8122-exec-3] - PDFg service manager http://127.0.0.1:8995/PDFgServlet/ registered. May 2, 2025 113852 AM Error [ajp-nio-127.0.0.1-8122-exec-5] - Error occurred while generating PDF.
d
"ColdFusion has introduced IP-based filtering on the Jetty side. View cfhtmltopdf for more information." That's probably the issue.
c
I've added that file to jetty as well and allowed the localhost as well as the IP for the server. \cfusion\jetty\etc\jetty-ipaccess.xml
<Set name="white">
<Array type="String"> <Item>xxx.xxx.xxx.xxx</Item> <Item>127.0.0.1</Item> </Array> </Set> Thanks for pointing that out. I forgot to mention that I did that in my initial post.
Having the IP filtering as posted did not fix the problem. I should have mentioned it in my last post.
Problem resolved. The instructions from the release note mentioned the "cfusion" folder. I poked around the "ColdFusionAdd-onService" folder and found a similar structure, so I put the extracted files there, restarted the CF and add-on service and now it's working. From the release note: "Extract the zip and replace all the files at cfusion\jetty\webapps\PDFgServlet\WEB-INF\classes\coldfusion\pdf\service." Currently, the extracted files are in both locations. I have not tested to see if it will work if it's only in the add-on folder.
👍🏻 1
👏 1
👍 1