How to configure PDF Service Manager so it verifies and I can use cfhtmltopdf?

477 Views Asked by At

We're attempting to use in our development environment, running CF 2021 Enterprise on Windows, but running into some road blocks.

When I attempt to use the <cfhtmltopdf> tag on a page, the error message says "No Service Manager is available." I found the PDF Manager in the CFAdmin. There is only one Service Manager listed. I clicked "Verify all Service Managers", which gives "Connection verification failed for PDF Service Manager: localhost. Check logs for more details."

The coldfusion-out log shows "Jul 27, 2023 14:47:32 PM Error [http-nio-8500-exec-8] - Connect to 127.0.0.1:8993 [/127.0.0.1] failed: Connection refused: connect http://127.0.0.1:8993/PDFgServlet/verify"

Web searching led me to the Coldfusion Add-On Service, so we downloaded and installed the Coldfusion Add-On service and restarted ColdFusion. I get the same errors from before.

I have attempted to systematically change the port numbers, as well as toggle the "https enabled" in the Service Manager record for each port number (I tried each port with and without https enabled), but I'm having no luck there, either - same errors as before. Granted, I only tried a handful of ports (8993 down to 8998), but I'm not sure how far I may need to go there.

I'm looking for suggestions for how to configure this so that I can use the <cfhtmltopdf> tag.

1

There are 1 best solutions below

0
On

I want to add here that for some readers, the problem described above is simply a result of a problem where the CF addon service (for Solr and/or CFHTMLtoPDF--aka pdfg) has been restarted, while CF was running.

As such, a simple solution (that some have found) has simply been to restart CF.

For those who can't do that, another "trick" is to edit the PDF service definition in the CF Admin (but not change it in any way), where submitting that "change" (in the CF Admin) will "reset" the connection. I have an extended comment with more detail in an Adobe forum discussion on this matter here.

And for those who may prefer to automate this task (and not "fiddle with" the CF Admin to solve this), I discuss a way to run an Admin API call in the next comment of that thread. Here is the code, to save you going there (and in case that link ever fails):

<cfscript>
// Login is always required. 
adminObj = createObject("component","cfide.adminapi.administrator");
adminObj.login("yourCFadminpw");
docObj = createObject("component","cfide.adminapi.document");
// change the args as needed to match your CF Admin settings
docObj.editServiceManager ( "localhost", "127.0.0.1", 8993, 2, "no" );
</cfscript>

PDF manager reset