Copy link to clipboard
Copied
I am trying to get the PDF manager to work on coldfusion 2025 (developer addition) running on Ubuntu with Apache web server. I did the full GUI install (ColdFusion_2025_GUI_WWEJ_linux64.bin ) select developer addition, all add ons etc. Did no install the separate addons download. So jetty is instslled under cfusion.
After installation I can verify the PDF Manager ( in my case the install changed the port to 8999). Like some other post I have seen I was seeing the unregistered in the log. Selecting edit and saving without any changes allowed me to verify and provided the reghistered log item:
May 2, 2025 07:15:06 AM Information [http-nio-8500-exec-4] - PDFg service manager http://127.0.0.1:8997/PDFgServlet/ unregistered.
May 2, 2025 07:15:06 AM Information [http-nio-8500-exec-4] - PDFg service manager http://127.0.0.1:8997/PDFgServlet/ registered.
I do have it connected to appache anbd the web root is set so in a file called test.cfm I have:
<cfhtmltopdf>
<h1>Hello World</h1>
</cfhtmltopdf>
When I naviage here (http://localhost/library/pfdf/test.cfm) the server tings about it and finally display this:
There is nothig written to the coldfusion or Jetty logs!! I an at a loss as to why. Previously I have used windows with no issues. But I need it to run on linux for a customer. Does any body have any ideas as to what is going on?
I did not get an answer from Adobe but I found that PDFReactor required a JVM setting if it was not running with a graphicl inferface. So in the jetty start.ini I added -Djava.awt.headless=true restarted Jetty and it worked. Ubuntu has a GUI so it kind of threw me as to why this would work. But in did. This was on a developer addition of ColdFusion2025. I then had a docker container with coldfusion2023 that had the same issue. I checked it heare and it worked as well.
So for now this appears to b
...Charlie, thank you for your help and here are my final notes:
To summarize, we had wanted to setup on Red Hat Enterprise Servers a single instance of the PDF Manager to handle calls from multiple ColdFusion servers ( currently running coldfusion 2023).
If you follow the Adobe instructions you will get the fonts that go in usr/share/fonts, but what you will not see is that first the PDFReactor underlying the remote pdf service requires a JVM flag -Djava.awt.headless=true, that goes in to jett
...Copy link to clipboard
Copied
1 Yes on start up coldfusion logs the enabling of port 5500 but a litle further down it reports Registration error for service manager : .http://xxx.x.x.x:8995/PDFgServlet/.Reason: SERVER ERROR
2 curl from remote server connects and shows:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 404 Not Found</title>
</head>
<body><h2>HTTP ERROR 404 Not Found</h2>
<table>
<tr><th>URI:</th><td>/</td></tr>
<tr><th>STATUS:</th><td>404</td></tr>
<tr><th>MESSAGE:</th><td>Not Found</td></tr>
<tr><th>SERVLET:</th><td>org.eclipse.jetty.servlet.ServletHandler$Default404Servlet-1687baf8</td></tr>
</table>
<hr/><a href=https://eclipse.org/jetty>Powered by Jetty:// 9.4.51.v20230217</a><hr/>
</body>
</html>
3. In the administrator the PDF Manager show as enabled. and it verifies. But trying to generate a PDF still does not work and shows an error . Just now I deleted the entry and recreated it. On adding it back I got the Enablinbg port 5500 to serve and receive content ... mwssage nothing else. I them tried to gerte a PDf and got two lines. The first Registration error for service manager : .http://xxx.x.x.x:8995/PDFgServlet/.Reason: SERVER ERROR and the second the Error occurred while generating PDF.
So I am at a loss again as to what to do. It seems we were so close. On windows I can get this to work but. That does not help me at work where we are now linux.
Copy link to clipboard
Copied
Ian, you may not be so far away as you presume. As I keep saying, there are a number of moving parts to this communication--and each environment may present a different challenge.
1) So first, as I've said a couple of times now, once the port 5500 stuff checks out, if the enabling or PDF generation still fails, you need to look again at the jetty request log (on that remote PDF server). Please confirm if the failures have changed there from being 500 status codes to 403's. That would be a new, different problem based on changes introduced by the May CF updates (and the new jetty-ipaccess.xml protection mechanism, which I've held off elaborating until we need to).
2) If you may find there are NO lines in the request log when you enable/verify the PDF service from CF, that's a different problem. Are you positive that the port on the remote PDF service is 8995?
And have you confirmed that you could do a curl to that ip and port (for that remote PDF service) from the CF machine ? Don't presume that this direction of communication is necessarily open. Just as you had to have them open port 5500 on the CF server to be reachable from the PDF service, so too must this 8995 be opened to be reachable from the CF server. That may be obvious and you've already checked it, but I have to ask. (And I realize that earlier in the thread you did report seeing 500 status code in that log. I just want to ensure nothing has changed given your recent firewall tweaking. If those jetty request log lines ARE happening when you do the verify or try to create a pdf, then that confirms CF CAN reach that server. In that case, that's why my point 1 focused on any change in that status code.)
3) I'll note also that it's certainly good news that the CF log showed port 5500 being enabled and started. At least we know that's tthe call-back port that would be used.
And it's actually ok that the curl of that port 5500 on this server (from the remote server) returned a 404. That confirms it's "running" and listening. Again it ONLY starts listening if you DO enable remote PDF services, like you saw was being logged.
4) Finally, if you look close at that 404 html you shared, you'll see it shows being a jetty response. That may seem confusing to folks trying to follow along. Let me clarify, as I've not mentioned it yet: this port 5500 we're discussing is actually YET ANOTHER JETTY implementation within CF. Yes, there are two! This one (for port 5500, which only starts when you enable a remote PDF service) is configured via a jetty.xml that is found in cfusion/lib. That's NOT the same one as in cfusion/jetty/etc.
(I'm assuming Adobe didn't leverage that jetty implemented within cfusion/jetty because technically someone could opted during install of CF to NOT install the add-on service, which provides that "local" PDFg and Solr functionality on the CF server. And some long-time troubleshooters may recognize this "other jetty" as being a holdover from the CF9.0.1 days, when Adobe first implemented it to be the optional "monitoring server" feature for the old CF Server Monitor. It provided an alternative web server to serve up the monitor, for "reasons".)
Anyway, enough of the history lesson. I just wanted to connect all these dots.
Please let us know what you find with regard to my poiints 1 and 2 above. If those check out ok, we can move on to additional steps.
Copy link to clipboard
Copied
To answer your questions:
1. Yes the 5500 ort is open and can be reached from t he sertver. The error in the server request log is still a 500 error.
2. The remote port is on 8995
The jetty.txt file has the log file entries. the start.ini.txt is the jetty configutation file from the server.
Copy link to clipboard
Copied
Ian, that's helpful info. Let's press on. I have new diagnostics for you to consider. The solution should be in reach.
1) First, though, I didn't ask if port 5500 was open. You'd already confirmed that. But the 500 status code is the key question I was asking, AND it confirms also that cf can reach the pdf server (my other question).
2) So let's focus now on the 500 (in the server log of the remote pdf service). More important, the additional stack trace within that log info you just shared now points to a problem that clearly remains.
Readers should note that Ian had buried in one of his attachments this statement: "I think my next step is to ask the admin to turn on jetty debugging. Bit I am not sure which module to set it for." (Ian, I'd plead you not to put text in those files. Most people won't read them.)
3) Anyway, I would say yes, additional logging would now be warranted, but no need to enable any jetty "module". Instead, we want the CF PDF service feature to give us logging about what it's doing (or failing to do).
To do that, go to the remote pdf server. If it's a CF instance as you've said, go to [cf]\cfusion\jetty\webapps\PDFgServlet\WEB-INF. (Those who may use an "add-on service" installer on the remote server would look instead at [cfaddon]\webapps\PDFgServlet\WEB-INF (note there's no jetty folder, as the folder you install the cf add-on service to IS the jetty folder.)
Then in that specific WEB-INF folder is a web.xml file where we want to tweak just one line. About 40 lines down that file are these lines:
<context-param>
<description>EnableLogging logs complete details about pdfg service and conversion request lifecycle. This option needs to be enabled for debugging purpose only. </description>
<param-name>enableLogging</param-name>
<param-value>false</param-value>
</context-param>
Change that "false" to "true" and restart that pdf service. (No need to change or do anything on the CF/client side other than to re-run your page that is failing.)
4) Enabling this will now create new files in the logs folder of that remote jetty instance. Let's focus on the one called::
htmltopdf_1_conversion.log.0
Weird name, I know. You'll see also a file called htmltopdf_1_conversion.log--without the 0, but I find it never has anything in it. Same with the files ending in .lck--some "lock" file, I assume. I've also found it to sometimes create a htmltopdf_2_conversion.log.0, usually with the same info as the one above.
Anwyay, for reference (for you to compare, or others to consider), I've attached here the log for my remote service. (Note that this upload feature wouldn't let me upload it with its name ending in log.0, to I renamed it to log.0.txt).
And to be clear I had enabled the logging, restarted that service, and am showing the lines for just one request to it. FWIW, that request was tracked in the jetty request log as this:
192.168.68.50 - - [30/Jul/2025:18:10:46 +0000] "POST /PDFgServlet/ HTTP/1.1" 200 51129 "-" "Apache-HttpClient/4.5.13 (Java/21.0.8)"
Note its time of 18:10:46 (which is GMT time, the default for that jetty request log). Be careful to note that the corresponding lines in the attached htmltopdf_1_conversion.log.0 for that request are instead shown as for the local timezone of that server (US Central, so 5 hrs earlier)...though sadly there's a bug in that it lacks the am/pm indicators, so it shows as 01:10--rather than 01:10pm or 13:10).
5) More important, this new log tracks about 60 lines for that one request of mine--which only did a cfoutput of now() in the cfhtmltopdf. That's what you'll want to pay attention to in yours.
For example, you'll see (per my log) the calls back to that calling CF instance (doing the cfhtmltopdf), which is at 192.168.68.50 (as is shown also in that request log line above: CF tells the PDF service what is the IP address of itself in the headers of the call it makes).
Note you'll also see references to "PDFreactor", which is the name of the product Adobe has licensed for producing PDFs when using cfhtmltopdf, since CF2023 (and is indicated in the setup of the CF Admin PDF services page as what's called "engine" version "2.0").
And in fact this remote pdf service was one for cf23 that I was calling from a cf2025 instance--but that works in either direction, and the same basic info should be logged if the PDF service is a cf25 version.
6) So enable and check out yours. Maybe you'll see some specific error among your lines that we can next dig into. If so, let us know.
I know it's a lot to take in--and frustrating that it "just doesn't work". As I said, there are lots of moving parts We can only treat it as a "black box" when it works. But as we've seen in all this discussion there are a) facets of the communication in both directions that need to be considered (which can be diagnosed)...and b) the work being done on the remote service (which has its own logs that can be considered).
Sadly, there's nothing currently that Adobe surfaces to us when a cfhtmltopdf fails because of something in all this back and forth and remote processing. We just get a blank result for the requested pdf. And that's why I have belabored all these details, to help folks in this situation (folks pay for this sort of help from me every day--and this has been more than several hours effort).
I hope you'll stick it out to resolution. Again, I think we're really getting close to solving what's amiss...and helping others along the way.
Copy link to clipboard
Copied
Charlie,
A t work I don''t have admin rights on the PDFMaanger Server so I have requeted the change. Hopefully that will be done this morning and I can get more information.. I'll report back what I find out.
Copy link to clipboard
Copied
Charlie,
A t work I don''t have admin rights on the PDFMaanger Server so I have requeted the change.
By @iclark3509
There you go. That is an example of the security risks I have been pointing out right from the start.
You've been going on about needing access/rights for the Add-On PDF-Generation Service. Why? It doesn't make sense to me. Which is why I requested that you explain your use-case to the forum.
Let's call the ColdFusion instance on which the Add-On Service is registered the first-party. This first-party delegates the responsibility for generating PDFs to a second-party, namely, the Add-On Service. Both are server-side. Why would you, as third-party or client, want to have the rights, hence the responsibility, for generating PDFs? And not just any rights, but Administrator rights.
Isn't it sufficient that you, the client, can make an HTTP request for a PDF to the first-party server, FP_CF? That normally requires no Administrator rights. The ColdFusion server FP_CF then delegates PDF-generation to the Add-On Service, after which FP_CF sends the result to you, the client. I have demonstrated this in an earlier post, providing a sample of the client code and server code.
Access to server back-end services is restricted for a reason. If you are allowed access, and are given permission to remotely run the services concerned, what will prevent malicious access through the same, or similar, backdoor? Beware that the favour you are asking of the System Administrator is the kind of social-engineering request that malicious hackers make.
Copy link to clipboard
Copied
31/07/2025 08:35:14.158 - [coldfusion.pdf.service.j.a] - [INFO] - [qtp1344645519-24] Initializing the Logging service is successful
31/07/2025 08:35:14.160 - [coldfusion.pdf.service.j.a] - [INFO] - [qtp1344645519-24] Launching the PDFG Service at port 1600
31/07/2025 08:35:34.173 - [coldfusion.pdf.service.j.a] - [SEVERE] - [qtp1344645519-24] Failed connecting to PDFGServer running at port 1600
31/07/2025 08:35:34.173 - [coldfusion.pdf.service.j.a] - [SEVERE] - [qtp1344645519-24] Failed to create CFPDFG service process
31/07/2025 08:35:34.174 - [coldfusion.pdf.service.j.a] - [SEVERE] - [qtp1344645519-24] null
31/07/2025 08:35:34.174 - [coldfusion.pdf.service.j.a] - [INFO] - [qtp1344645519-24] Created and Launched 1 services.
31/07/2025 08:35:34.175 - [coldfusion.pdf.service.j.a] - [INFO] - [qtp1344645519-24] Created Waiting Queue of size: 10
31/07/2025 08:35:34.177 - [coldfusion.pdf.service.j.a] - [INFO] - [qtp1344645519-24] Initializing the Logging service is successful
31/07/2025 08:35:34.188 - [coldfusion.pdf.service.j.a] - [INFO] - [qtp1344645519-24] Created and Launched 1 services.
31/07/2025 08:35:34.189 - [coldfusion.pdf.service.j.a] - [INFO] - [qtp1344645519-24] Created Waiting Queue of size: 10
31/07/2025 08:35:34.290 - [coldfusion.pdf.service.j.a] - [SEVERE] - [qtp1344645519-24] Error occurred while registering the CF server
31/07/2025 08:35:34.290 - [coldfusion.pdf.service.j.a] - [SEVERE] - [qtp1344645519-24] null
31/07/2025 08:42:39.537 - [coldfusion.pdf.service.j.a] - [INFO] - [qtp1344645519-24] Initializing the Logging service is successful
31/07/2025 08:42:39.539 - [coldfusion.pdf.service.j.a] - [INFO] - [qtp1344645519-24] Launching the PDFG Service at port 1600
31/07/2025 08:42:59.551 - [coldfusion.pdf.service.j.a] - [SEVERE] - [qtp1344645519-24] Failed connecting to PDFGServer running at port 1600
31/07/2025 08:42:59.552 - [coldfusion.pdf.service.j.a] - [SEVERE] - [qtp1344645519-24] Failed to create CFPDFG service process
31/07/2025 08:42:59.552 - [coldfusion.pdf.service.j.a] - [SEVERE] - [qtp1344645519-24] null
31/07/2025 08:42:59.552 - [coldfusion.pdf.service.j.a] - [INFO] - [qtp1344645519-24] Created and Launched 1 services.
31/07/2025 08:42:59.554 - [coldfusion.pdf.service.j.a] - [INFO] - [qtp1344645519-24] Created Waiting Queue of size: 10
31/07/2025 08:42:59.555 - [coldfusion.pdf.service.j.a] - [INFO] - [qtp1344645519-24] Initializing the Logging service is successful
31/07/2025 08:42:59.566 - [coldfusion.pdf.service.j.a] - [INFO] - [qtp1344645519-24] Created and Launched 1 services.
31/07/2025 08:42:59.567 - [coldfusion.pdf.service.j.a] - [INFO] - [qtp1344645519-24] Created Waiting Queue of size: 10
31/07/2025 08:42:59.669 - [coldfusion.pdf.service.j.a] - [SEVERE] - [qtp1344645519-24] Error occurred while registering the CF server
31/07/2025 08:42:59.669 - [coldfusion.pdf.service.j.a] - [SEVERE] - [qtp1344645519-24] null
Copy link to clipboard
Copied
My first attempt did not uncoer muc. After the logging was enabled. I thought I had replied to this comment but I might of put in else where. In any case I think this is better. I released that my Cold Fusion was 2023 with no patches applied and the PDFManager server was 2023 patch 15 applied ( not sre why it would matter) in any case up updated mine to patch 15. and tried again. I now get thesse log items ( I enlarged the lines that say severe) which is a connection refused. But not indication of which connection!
There was no additional information in any other logs.
Log items:
31/07/2025 03:52:05.235 - [coldfusion.pdf.service.j.a] - [INFO] - [PDFReactorThread] Selecting PDFREACTORservice from available idle services
31/07/2025 03:52:05.235 - [coldfusion.pdf.service.j.a] - [INFO] - [PDFReactorThread] Service selected: class a.e
31/07/2025 03:52:05.235 - [coldfusion.pdf.service.j.a] - [INFO] - [PDFReactorThread] Executing the task using service: class a.e
31/07/2025 03:52:05.239 - [coldfusion.pdf.service.j.a] - [INFO] - [pool-3-thread-1] Conversion Request Data received and parsed.
31/07/2025 03:52:05.242 - [coldfusion.pdf.service.j.a] - [INFO] - [pool-3-thread-1] Conversion Settings configured.
31/07/2025 03:52:05.492 - [coldfusion.pdf.service.j.a] - [SEVERE] - [pool-3-thread-1] java.net.ConnectException: Connection refused
31/07/2025 03:52:05.492 - [coldfusion.pdf.service.j.a] - [SEVERE] - [pool-3-thread-1] Error occurred during PDF conversion for request :java.net.ConnectException: Connection refused
31/07/2025 03:52:05.492 - [coldfusion.pdf.service.j.a] - [SEVERE] - [pool-3-thread-1] com.realobjects.pdfreactor.PDFreactor$ConversionWrapper.convert(l:253) at com.realobjects.pdfreactor.PDFreactor.convert(l:78) at a.e.a(Unknown Source) at a.e.a(Unknown Source) at coldfusion.pdf.service.remote.a.a(Unknown Source) at coldfusion.pdf.service.p$a.run(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:842)
31/07/2025 03:52:05.492 - [coldfusion.pdf.service.j.a] - [SEVERE] - [pool-3-thread-1] java.net.ConnectException: Connection refused
31/07/2025 03:52:05.492 - [coldfusion.pdf.service.j.a] - [SEVERE] - [pool-3-thread-1] com.realobjects.pdfreactor.PDFreactor$ConversionWrapper.convert(l:253) at com.realobjects.pdfreactor.PDFreactor.convert(l:78) at a.e.a(Unknown Source) at a.e.a(Unknown Source) at coldfusion.pdf.service.remote.a.a(Unknown Source) at coldfusion.pdf.service.p$a.run(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:842)
31/07/2025 03:57:52.299 - [coldfusion.pdf.service.j.a] - [INFO] - [qtp1344645519-22] Added the conversion task to waitingQ successfully
31/07/2025 03:57:52.299 - [coldfusion.pdf.service.j.a] - [INFO] - [PDFReactorThread] Task picked up by: PDFREACTOR
31/07/2025 03:57:52.299 - [coldfusion.pdf.service.j.a] - [INFO] - [PDFReactorThread] Selecting PDFREACTORservice from available idle services
31/07/2025 03:57:52.299 - [coldfusion.pdf.service.j.a] - [INFO] - [PDFReactorThread] Service selected: class a.e
31/07/2025 03:57:52.299 - [coldfusion.pdf.service.j.a] - [INFO] - [PDFReactorThread] Executing the task using service: class a.e
31/07/2025 03:57:52.301 - [coldfusion.pdf.service.j.a] - [INFO] - [pool-3-thread-2] Conversion Request Data received and parsed.
31/07/2025 03:57:52.302 - [coldfusion.pdf.service.j.a] - [INFO] - [pool-3-thread-2] Conversion Settings configured.
31/07/2025 03:57:52.316 - [coldfusion.pdf.service.j.a] - [SEVERE] - [pool-3-thread-2] java.net.ConnectException: Connection refused
31/07/2025 03:57:52.316 - [coldfusion.pdf.service.j.a] - [SEVERE] - [pool-3-thread-2] Error occurred during PDF conversion for request :java.net.ConnectException: Connection refused
31/07/2025 03:57:52.316 - [coldfusion.pdf.service.j.a] - [SEVERE] - [pool-3-thread-2] com.realobjects.pdfreactor.PDFreactor$ConversionWrapper.convert(l:253) at com.realobjects.pdfreactor.PDFreactor.convert(l:78) at a.e.a(Unknown Source) at a.e.a(Unknown Source) at coldfusion.pdf.service.remote.a.a(Unknown Source) at coldfusion.pdf.service.p$a.run(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:842)
31/07/2025 03:57:52.316 - [coldfusion.pdf.service.j.a] - [SEVERE] - [pool-3-thread-2] java.net.ConnectException: Connection refused
31/07/2025 03:57:52.316 - [coldfusion.pdf.service.j.a] - [SEVERE] - [pool-3-thread-2] com.realobjects.pdfreactor.PDFreactor$ConversionWrapper.convert(l:253) at com.realobjects.pdfreactor.PDFreactor.convert(l:78) at a.e.a(Unknown Source) at a.e.a(Unknown Source) at coldfusion.pdf.service.remote.a.a(Unknown Source) at coldfusion.pdf.service.p$a.run(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:842)
Copy link to clipboard
Copied
UPDATE: It might still be the port 5500 that is the issue.
It was opened on both machnes. But another test this moring I saw that the curl command ws not working either way. So we did a traceroute and found a gateway server inbetween the two servers that we think might be blocking the port. The Admin is going to check with the data center staff to see if we can get the port enabled at least on a temorary basis. If it get opened I am hopeful it will solve the isuee.
If tht is the case I don;t think it will be an issue on our servers as traffic between them would not run through the same gateway. I' ll report back what I find out.
Copy link to clipboard
Copied
If you're getting an HTTP 404 response, it means you're probably connecting to the right host, but the host can't resolve the URL. And in your cURL response, you're getting that 404 from Jetty, not Tomcat or any other web or application server. So it sounds like you might have to find the correct filepath for the URL and use that instead of whatever you're using now. I'm sorry I can't provide any better answer right now.
Copy link to clipboard
Copied
Hi @iclark3509 , one thing is certain. You are close to solving the problem. So hang on in there.
Why I say "close"? The previous error had status 500, which is a server error. That is pretty heavy, as it involves looking into the PDF engine. However, now you're having errors of status 404, which are client errors. So we can do something about these. Hence the following request for information.
Could you share the code you use on the client-side to generate the PDF?
Copy link to clipboard
Copied
Dave and bkbk, to be clear the 404 he gets is on his curl of the cf server's port 5500 from the remote pdf server. That was to confirm the latter could reach the former, once it showed being enabled during his cf startup. So the 404 is a good sign. See my reply before each of yours (from last night) for more.
What we await now is confirmation of what the status code is on the pdf server's request log, for the call from cf. We don't yet KNOW if it's now a 500. That was a key question I'd asked him in my reply last night, among others.
As for WHAT is in the cfhtmltopdf, that MAY be interesting, but to be clear it could be just the word 'test" and still be failing, FWIW. More than that, note he'd said the verify of the pdf service was still failing.
That's why I'd focused on now first the communication from the cf server to the remote pdf server (the success of which may have changed since he had tweaked the firewall), and then what status code (if any) was now being logged. I know I'd written a lot. Just summarizing and putting it in context with your respective comments, while we await his reply/replies.
Copy link to clipboard
Copied
@Charlie Arehart , thanks for your explanation. That clarifies some points. But I still have two as yet unanswered questions on the subject:
(1) What is the use-case?
As I understand from @iclark3509 's explanation, ColdFusion is running on two separate servers, CF1 and CF2. In client-server terms, one of them, say, CF1, is the client. CF2 is the server.
CF1 makes a remote request to CF2 for a PDF document. Then CF2 uses its PDF engine to generate a PDF, which it uses to fulfill the request.
We all know that one ColdFusion server is sufficient for generating a PDF document. So the question is, in @iclark3509 's particular situation, what is the use-case for using 2 ColdFusion servers in this way? I ask because invoking services remotely is fraught with vulnerabilities and security risks.
(2) What is the set-up of the client and the server?
What is the set-up of the client, CF1 (that is CF settings, request code, etc.)?
What is the set-up of the server, CF2 (that is CF settings, response code, etc.)?
Copy link to clipboard
Copied
Well, those questions aside, I'm just focused on the technical matter of a given cf instance talking to a given remote pdf service--and the issues that can arise (and some that Ian has confirmed).
For example, someone may specifically WANT to offload all pdf generation to a machine separate from cf. (Or since cfhtmltopdf let's you name a pdf server as an attribute, maybe one would have SOME PDFs generated locally and others remote.)
And for some people that remote pdf server may be the one implemented optionally within "another cf instance" on that other server, while for others they'd be using the available cf add-on service installer there to setup ONLY the pdf service (no cf at all on that server).
So while you can reasonably want to check why he's doing whatever he's doing, it could be one of these reasonable scenarios. Even if not, what's being discussed could benefit ANYONE dealing with CF talking to a remote pdf service. 🙂
And as I'd noted previously, that's a rather rare situation (use of remote pdf services, even if done for a reasonable use case), for which there's pretty scant discussion and docs (virtually none mention this 5500 port that gets enabled in cf once a remote pdf service is registered).
So I hope this thread ultimately benefits folks beyond Ian...and if nothing else, by feeding knowledge to the AIs to find. Sadly, for humans, it is lamentable that this whole remote service discussion isn't its own thread. By far most discussion is well AFTER what's marked as the "answer" for his original question. 😞
Anyway, let's hear what Ian has to say to the outstanding line of questioning from last night, as we were indeed getting close to resolution, I think (and hope).
Copy link to clipboard
Copied
Well, those questions aside, I'm just focused on the technical matter of a given cf instance talking to a given remote pdf service--and the issues that can arise (and some that Ian has confirmed).
By @Charlie Arehart
To be clear, I, too, am focused on the technical matter of a given cf instance talking to a given remote pdf service. My questions, about use-case and configuration, are vital in this matter. Reread my last post, bearing the following in mind, and you will see that.
Though I miss clarity on the two questions, I have so far been using some working assumptions. My first assumption is the following use-case.
ColdFusion 2023 has been installed on a Linux version (CF1) that doesn’t support running PDFg. So, @iclark3509 and team have had to install and run the PDFg Add-On Service separately on Windows (or some other compatible Operating System), and registering it, of course, with the ColdFusion running on that Operating System (CF2).
To summarize,
Some implications of this for @iclark3509 :
<cfhttp url="http://[CF2_IP_ADDRESS]:[CF2_PORT]/generatePDF.cfm"
method="post"
result="pdfResult"
timeout="10">
<cfhttpparam type="formField" name="htmlContent" value="Some content from an HTML form-field (from CF1)">
</cfhttp>
<!--- Handle response --->
<cfif pdfResult.statusCode EQ "200 OK">
<!-- Serve directly to browser -->
<cfheader name="Content-Disposition" value="inline; filename=remote_generated.pdf">
<cfcontent type="application/pdf" variable="#pdfResult.fileContent.toByteArray()#">
<cfelse>
<cfoutput>Failed to generate PDF. Error: #pdfResult.statusCode#</cfoutput>
</cfif>
<cfparam name="form.htmlContent" default="Default form-field content (from CF2)">
<!--- Use cfhtmltopdf to leverage the PDFg Add-On --->
<cfhtmltopdf name="pdfDoc">
<cfoutput>#form.htmlContent#</cfoutput>
</cfhtmltopdf>
<!--- Stream the PDF back to CF1 --->
<cfheader name="Content-Disposition" value="inline; filename=remote.pdf">
<cfcontent type="application/pdf" variable="#variables.pdfDoc#">
There are 2 ways to verify:
1st way to verify:
Navigate to [ADD-ON_SERVICE_INSTALLATION_DIRECTORY]/etc/. Open the file jetty.xml in an editor. Ensure that it contains an element that looks like this:
<call name="addConnector">
<arg>
<new class="org.eclipse.jetty.server.ServerConnector">
<arg><ref id="Server"/></arg>
<set name="host"><property name="jetty.host" default="192.168.178.108"/></set>
<set name="port"><property name="jetty.port" default="5500"/></set>
</new>
</arg>
</call>
(If you face problems binding with 192.168.178.108, then experiment by replacing it with 0.0.0.0, which will accept all remote connections. I hope you begin to see potential vulnerabilities and security risks. Beware. Even with internal IP addresses, RBAC security measures may be bypassed here.)
2nd way to verify:
Open the ColdFusion Administrator on CF2. Navigate to Data & Services > PDF Service. You should see two services registered: one with 127.0.0.1:8997 and one with 192.168.178.108:5500. Confirm that the setting 192.168.178.108:5500 matches the values in the jetty.xml file. Click on the button "Verify All Service Managers". Then click on the button to start the service manager.
Finally, remember that the above is all based on assumption. The aim is to give you suggestions on further debugging, experimentation and exploration.
Copy link to clipboard
Copied
Ok
Copy link to clipboard
Copied
Hi @iclark3509 ,
I was about to test the remote generation of PDF using two ColdFusion servers. But I shall now hold my horses, in view of the hopeful developments following @Charlie Arehart 's latest post.
Copy link to clipboard
Copied
Perhaps the most important suggestion of all: remember there's always Adobe's ColdFusion Team to turn to, as you did once before.
Copy link to clipboard
Copied
At work I do have a ticket open. The admins are working with Adobe but like me they are not having any luck.
Copy link to clipboard
Copied
At work I do have a ticket open. The admins are working with Adobe but like me they are not having any luck.
By @iclark3509
Nice! I hope Adobe folks will see this and get cracking.
Copy link to clipboard
Copied
I am looking into how to get ColdFusion's PDF Service to generate a PDF remotely, by means of two ColdFusion servers, with one server acting as client and the other as host/server.
In the meantime, I'd like to share two links I came across:
https://helpx.adobe.com/coldfusion/pdf-generation-in-coldfusion.html
https://community.adobe.com/t5/coldfusion-discussions/cfdocument-hang-timeout-error/td-p/1921811
Copy link to clipboard
Copied
Readers who come here to the bottom of this multi-page list of replies should take note that Ian had raised in late July a new issue about remote PDF services issues. Some good news is that it seems he's come to a resolution on that, but given the threaded nature of this UI it's not here at the end (or even on this currently second page) but instead in another discussion.
See the couple of messages between us above and below this one of his where he reported seeming to have made real progress, especially dealing with firewall matter which I suspected was at issue--regarding the port 5500 that the remote add-on service calls back to (in the CF instance trying to create the PDF). Much more on this there.
I just want to add this here for those who may "jump to the bottom" to find the conclusion. I realize that it's possible that in time still other new messages may appear here, but I'm writing this on the preumption this may just as likely remain as the "last message" in the thread here. 🙂
Copy link to clipboard
Copied
Charlie, thank you for your help and here are my final notes:
To summarize, we had wanted to setup on Red Hat Enterprise Servers a single instance of the PDF Manager to handle calls from multiple ColdFusion servers ( currently running coldfusion 2023).
If you follow the Adobe instructions you will get the fonts that go in usr/share/fonts, but what you will not see is that first the PDFReactor underlying the remote pdf service requires a JVM flag -Djava.awt.headless=true, that goes in to jetty start.ini file. You also need to edit the jetty/etc/jetty-ipaccess.xml file on that server to add the IP of any cf server that needs to access the PDF service.
The next big items are the required ports. From the client to the PDF Manager server, you need 8995 (default for 2023 but it could be different). The one that there is no apparent documentation on is that port 5500 on the calling cf server must be reachable from the pdf service machine. This is the one that had been giving me issues. This is used to receive the rendered PDF from the PDF Manager.
And I made sure the firewall had this port open, but it still did not connect. I initially thought it might be still some other firewall or gateway machine blocking it.
But while trying to set a web server connection between ColdFusion and Apache and getting 503 error messages, I saw references to "SELinux". This is a security layer on Red Hat Linux servers that was enabled without my knowledge, which was blocking the port.
As soon as port 5500 was opened up in SELINUX, my connector worked and so did the remote PDF generation.
While I did waste a lot of time on these port issues, as a developer I did get our Linux Admins to think about giving the developers more insight into what was configured on the virtual servers so hopefully going forward we will have more insight and visibility.
Ian
Copy link to clipboard
Copied
Great to see the concluding summary and to hear that the key was first that port 5500 (which readers can find I introduced and discussed more above) and then that selinux was blocking it even once you'd opened it in your firewall (this is the first mention of that here, so thanks).
These are indeed all valuable things for folks (and Adobe) to consider about enabling remote pdf services, especially when they are on different machines or using selinux. I hope the additional discussion of diagnosing the problem may help others, especially when the port numbers maybe different (for any of several reasons, also discussed above).
Best of all, glad it's resolved for you. When you first raised this new part of the discussion in May, you seemed on the verge of feeling you'd need to move off of CF, or perhaps only for pdf services. Surely many get to that point, and some may feel justified or even encouraged by that prospect (or alternatives they may find).
Given that Adobe licenses PDF Reactor as the underlying engine for cfhtmltopdf (since cf2023), which would be VERY expensive for us to do on our own, I'm all the more happy that we all on this thread have contributed key knowledge to the community. Indeed, I hope to do a blog post with my own summary of the conclusion, as some won't have the stomach to wade through all this, or may not even see your summary--which I will mark now as another "answer" for this thread. 🙂
Copy link to clipboard
Copied
@iclark3509 , what you went through is a rare experience. Thank you for sharing it with the forum.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now