I can’t seem to find any documentation on how to add an image into a PDF with this library, I’ve seen some comments online suggesting that you first read the image with <cfimage and then convert it using toBase64 and then use that value in the tag, but all I’m getting is: “java.lang.IllegalStateException”
@mcgrawwv Base64 would be the correct method - as the data needs to be a string. That said, you will need to make sure the data is escaped as it will be transmitted in the XML. If you can post the full stack trace of the error, I can confirm that encoding is the issue
Here is an image of the error I was getting. How would I go about escaping the string? I’m not using the populate from XML method, or should I? I was just using the cfpdfformparam route.
I used ChatGPT to ask this same question and it said it couldn’t find anything related to images and this and recommended I used the watermark features, and that semi works, but the images are degrading too much, so I would be stoked to have you help me get this working.
Tried this as well, and I’m getting the same error:
<cfpdfformparam name="P6 Photo 1" value="#encodeforXML(myImage)#" />
and
<cfpdfformparam name="P6 Photo 1" value="#encodeforXML(toBase64(myImage))#" />
Stack Trace in Text form is this helps more than the screenshot
lucee.runtime.exp.NativeException: java.lang.IllegalStateException at org.apache.pdfbox.pdmodel.interactive.annotation.PDAppearanceEntry.getSubDictionary(PDAppearanceEntry.java:97) at org.apache.pdfbox.pdmodel.interactive.form.PDButton.getOnValues(PDButton.java:314) at org.apache.pdfbox.pdmodel.interactive.form.PDButton.checkValue(PDButton.java:336) at org.apache.pdfbox.pdmodel.interactive.form.PDButton.setValue(PDButton.java:153) at lucee.invoc.wrap.v4.org.apache.pdfbox.pdmodel.interactive.form.PDButton.setValue_1ohgdbv88suv8.apply(Unknown Source) at lucee.runtime.reflection.pairs.MethodInstance.invoke(MethodInstance.java:96) at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:824) at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:2069) at cfc.ortuspdf_cfc$cf$9s.udfCall2(/cfc/OrtusPDF.cfc:310) at cfc.ortuspdf_cfc$cf$9s.udfCall(/cfc/OrtusPDF.cfc) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:357) at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:214) at lucee.runtime.type.scope.UndefinedImpl.callWithNamedValues(UndefinedImpl.java:829) at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:858) at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:2099) at cfc.ortuspdf_cfc$cf$9s.udfCall1(/cfc/OrtusPDF.cfc:99) at cfc.ortuspdf_cfc$cf$9s.udfCall(/cfc/OrtusPDF.cfc) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:357) at lucee.runtime.type.UDFImpl.call(UDFImpl.java:224) at lucee.runtime.type.scope.UndefinedImpl.call(UndefinedImpl.java:811) at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:773) at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:2069) at cfc.ortuspdf_cfc$cf$9s.udfCall1(/cfc/OrtusPDF.cfc:70) at cfc.ortuspdf_cfc$cf$9s.udfCall(/cfc/OrtusPDF.cfc) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:357) at lucee.runtime.type.UDFImpl.call(UDFImpl.java:224) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:678) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:595) at lucee.runtime.ComponentImpl.call(ComponentImpl.java:2101) at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:773) at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:2069) at pdfform_cfm$cf$9r.call(/pdfform.cfm:55) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1082) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1006) at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:998) at lucee.runtime.tag.CFTag.doInclude(CFTag.java:319) at lucee.runtime.tag.CFTag.cfmlEndTag(CFTag.java:260) at lucee.runtime.tag.CFTag.doAfterBody(CFTag.java:207) at site.webapp.export_elevation.generatepdf_cfm$cf$9x.call(/site/webapp/Export_Elevation/generatePDF.cfm:192) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1082) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1006) at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:987) at index_cfm$cf$94.call(/index.cfm:30) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1082) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1006) at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:213) at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:41) at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2810) at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2797) at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2768) at lucee.runtime.engine.Request.exe(Request.java:45) at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1109) at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:1066) at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:97) at lucee.loader.servlet.jakarta.CFMLServlet.service(CFMLServlet.java:52) at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:710) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:130) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:109) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:79) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:483) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:116) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:396) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:903) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1744) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:59) at java.base/java.lang.Thread.run(Unknown Source) Caused by: java.lang.IllegalStateException ... 78 more
First off, if you could update your PDF extension version to the latest, that would help. The line numbers in the stack trace don’t match the current release.
Try passing in the raw binary of the image. From what I’m reading, it should be able to handle the binary object and convert it.
<cfpdfformparam name="P6 Photo 1" value="#toBinary( toBase64( myImage ) )#" />
We just installed it, so I assumed we were on the latest, but I’ve asked my server guy to make sure’ it’s the latest release. I also added the toBinary() and still get an error:
Stack Trace
lucee.runtime.exp.NativeException: java.lang.IllegalStateException at org.apache.pdfbox.pdmodel.interactive.annotation.PDAppearanceEntry.getSubDictionary(PDAppearanceEntry.java:97) at org.apache.pdfbox.pdmodel.interactive.form.PDButton.getOnValues(PDButton.java:314) at org.apache.pdfbox.pdmodel.interactive.form.PDButton.checkValue(PDButton.java:336) at org.apache.pdfbox.pdmodel.interactive.form.PDButton.setValue(PDButton.java:153) at lucee.invoc.wrap.v4.org.apache.pdfbox.pdmodel.interactive.form.PDButton.setValue_1ohgdbv88suv8.apply(Unknown Source) at lucee.runtime.reflection.pairs.MethodInstance.invoke(MethodInstance.java:96) at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:824) at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:2069) at cfc.ortuspdf_cfc$cf$9s.udfCall2(/cfc/OrtusPDF.cfc:310) at cfc.ortuspdf_cfc$cf$9s.udfCall(/cfc/OrtusPDF.cfc) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:357) at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:214) at lucee.runtime.type.scope.UndefinedImpl.callWithNamedValues(UndefinedImpl.java:829) at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:858) at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:2099) at cfc.ortuspdf_cfc$cf$9s.udfCall1(/cfc/OrtusPDF.cfc:99) at cfc.ortuspdf_cfc$cf$9s.udfCall(/cfc/OrtusPDF.cfc) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:357) at lucee.runtime.type.UDFImpl.call(UDFImpl.java:224) at lucee.runtime.type.scope.UndefinedImpl.call(UndefinedImpl.java:811) at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:773) at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:2069) at cfc.ortuspdf_cfc$cf$9s.udfCall1(/cfc/OrtusPDF.cfc:70) at cfc.ortuspdf_cfc$cf$9s.udfCall(/cfc/OrtusPDF.cfc) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:357) at lucee.runtime.type.UDFImpl.call(UDFImpl.java:224) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:678) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:595) at lucee.runtime.ComponentImpl.call(ComponentImpl.java:2101) at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:773) at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:2069) at pdfform_cfm$cf$9r.call(/pdfform.cfm:55) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1082) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1006) at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:998) at lucee.runtime.tag.CFTag.doInclude(CFTag.java:319) at lucee.runtime.tag.CFTag.cfmlEndTag(CFTag.java:260) at lucee.runtime.tag.CFTag.doAfterBody(CFTag.java:207) at site.webapp.export_elevation.generatepdf_cfm$cf$b1.call(/site/webapp/Export_Elevation/generatePDF.cfm:297) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1082) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1006) at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:987) at index_cfm$cf$94.call(/index.cfm:30) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1082) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1006) at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:213) at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:41) at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2810) at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2797) at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2768) at lucee.runtime.engine.Request.exe(Request.java:45) at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1109) at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:1066) at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:97) at lucee.loader.servlet.jakarta.CFMLServlet.service(CFMLServlet.java:52) at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:710) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:130) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:109) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:79) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:483) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:116) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:396) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:903) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1744) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:59) at java.base/java.lang.Thread.run(Unknown Source) Caused by: java.lang.IllegalStateException ... 78 more
P.S. I appreciate the support!
Looks like we were on Lucee 6, so we didn’t have the latest version of your Library, so were getting that updated and we will try the latest version.
Here is where we are stuck at now, based on not being on the latest version we upgraded to Lucee 7 and now we can’t get the extension to activate, we’ve tried all the steps noted on your website and consulted AI, and it’s erroring trying to register the extension, here is the error trace:
Lucee 7.0.1.100 Error (java.lang.NoClassDefFoundError)
Message org/apache/log4j/Logger
AI For AI-driven exception analysis setup, see AI Setup Guide.
Stacktrace The Error Occurred in
/opt/lucee7/tomcat/lucee-server/context/context/admin/plugin/OrtusPDF/Action.cfc: line 22
20: function init( struct lang, struct app ) {
21: variables.licenseHelper = createObject( 'java', 'ortus.extension.pdf.util.LicenseHelper' );
22: variables.trialExpiration = variables.licenseHelper.getTrialExpiration();
23:
24: variables.activationServer = "https://www.ortussolutions.com/store/activate/index";
called from /admin/plugin.cfm: line 39
called from /admin/web.cfm: line 528
called from /admin/web.cfm: line 522
called from /admin/index.cfm: line 3
Java Stacktrace lucee.runtime.exp.NativeException: org/apache/log4j/Logger
at ortus.extension.pdf.util.LicenseHelper.<clinit>(LicenseHelper.java:35)
at lucee.invoc.wrap.v4.ortus.extension.pdf.util.LicenseHelper.getTrialExpiration.apply(Unknown Source)
at lucee.runtime.reflection.pairs.MethodInstance.invoke(MethodInstance.java:68)
at lucee.runtime.java.JavaObject.call(JavaObject.java:274)
at lucee.runtime.java.JavaObject.call(JavaObject.java:292)
at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:773)
at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:2069)
at ortuspdf.action_cfc$cf.udfCall(/lucee_plugin_directory/OrtusPDF/Action.cfc:22)
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:116)
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:361)
at lucee.runtime.type.UDFImpl.call(UDFImpl.java:228)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:798)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:709)
at lucee.runtime.ComponentImpl.call(ComponentImpl.java:2259)
at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:773)
at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:2069)
at plugin_cfm$cf.call(/admin/plugin.cfm:39)
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1084)
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1008)
at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:989)
at web_cfm$cf.call_000013(/admin/web.cfm:528)
at web_cfm$cf.call(/admin/web.cfm:522)
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1084)
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1008)
at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:989)
at index_cfm$cf.call(/admin/index.cfm:3)
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1084)
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1008)
at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:239)
at lucee.runtime.listener.ModernAppListener.onRequest(ModernAppListener.java:108)
at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2806)
at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2793)
at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2764)
at lucee.runtime.engine.Request.exe(Request.java:45)
at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1174)
at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:1131)
at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:99)
at lucee.loader.servlet.jakarta.CFMLServlet.service(CFMLServlet.java:41)
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:710)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:128)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:107)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:165)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:77)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:113)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:83)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:72)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:341)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:397)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:903)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1778)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:946)
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:480)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:57)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Logger
... 58 more
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger
at lucee.commons.lang.PhysicalClassLoader.loadClass(PhysicalClassLoader.java:269)
at lucee.commons.lang.PhysicalClassLoader.loadClass(PhysicalClassLoader.java:140)
... 58 more
Timestamp 3/3/26 4:38:04 PM EST
Hi @mcgrawwv — it looks like the extension stopped working on Lucee 7 because Lucee changed how the Admin plugin creates Java objects internally. From what we were told directly by the only Lucee developer, this change happened without prior notice to extension developers like us.
The challenge on our side is that supporting Lucee 7 would require a fairly extensive rewrite of the extension.
Right now, our development focus has shifted to BoxLang (www.boxlang.io), where we’ve built native versions of these capabilities — and quite a bit more — so that’s where we’re putting our engineering effort.
Given that, it seems like there are two practical paths forward:
Continue running on Lucee 5/6 where the extension works as designed.
We can help you migrate to BoxLang at no cost, and provide a BoxLang+ license so you keep all the PDF capabilities while gaining the additional features included with the + license.
@jclausen and I are the ones that wrote the PDF capabilities, so we can assist you with all of your needs and build automated patches for BoxLang if required.
Which direction makes the most sense for you right now?
We were previously not on Lucee 7, so we can downgrade that, but jclausen mentioned we weren’t on the latest version. This was purchased for a 1 time need to generate a fillable PDF, that’s all we need, so I’d prefer to just get this working with images and call it good. Can you point me to the latest build for the latest version of Lucee you support so my server guy can get it setup exactly to the specs you need?
I forgot to click reply, and I’m not sure if you get an alert when I just post, but I responded to this in my other comment.
No problem at all. I think it was a miscommunication. The latest version of our extension which should be found via forgebox
If it still doesn’t work then we can see how to patch it for you.
Ok, we’re back to Lucee 6, and using version 2.1.0.1898 of your extension. It’s still failing, my code is pretty basic:
<cfimage name="myImage" action="read" source="#surveyPhotoPath##photoInFocus#" />
<!--- <cfdump var="#myImage#" /> --->
<cfpdfformparam name="P6 Photo 1" value="#toBinary( toBase64( myImage ) )#" />
Here is a screen grab from Acrobat showing the image field in the fillable PDF:
Here is the Stack Trace:
lucee.runtime.exp.NativeException: java.lang.IllegalStateException at org.apache.pdfbox.pdmodel.interactive.annotation.PDAppearanceEntry.getSubDictionary(PDAppearanceEntry.java:97) at org.apache.pdfbox.pdmodel.interactive.form.PDButton.getOnValues(PDButton.java:314) at org.apache.pdfbox.pdmodel.interactive.form.PDButton.checkValue(PDButton.java:336) at org.apache.pdfbox.pdmodel.interactive.form.PDButton.setValue(PDButton.java:153) at lucee.invoc.wrap.v4.org.apache.pdfbox.pdmodel.interactive.form.PDButton.setValue_1ohgdbv88suv8.apply(Unknown Source) at lucee.runtime.reflection.pairs.MethodInstance.invoke(MethodInstance.java:96) at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:824) at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:2069) at cfc.ortuspdf_cfc$cf.udfCall2(/cfc/OrtusPDF.cfc:310) at cfc.ortuspdf_cfc$cf.udfCall(/cfc/OrtusPDF.cfc) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:357) at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:214) at lucee.runtime.type.scope.UndefinedImpl.callWithNamedValues(UndefinedImpl.java:829) at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:858) at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:2099) at cfc.ortuspdf_cfc$cf.udfCall1(/cfc/OrtusPDF.cfc:99) at cfc.ortuspdf_cfc$cf.udfCall(/cfc/OrtusPDF.cfc) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:357) at lucee.runtime.type.UDFImpl.call(UDFImpl.java:224) at lucee.runtime.type.scope.UndefinedImpl.call(UndefinedImpl.java:811) at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:773) at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:2069) at cfc.ortuspdf_cfc$cf.udfCall1(/cfc/OrtusPDF.cfc:70) at cfc.ortuspdf_cfc$cf.udfCall(/cfc/OrtusPDF.cfc) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:357) at lucee.runtime.type.UDFImpl.call(UDFImpl.java:224) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:678) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:595) at lucee.runtime.ComponentImpl.call(ComponentImpl.java:2101) at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:773) at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:2069) at pdfform_cfm$cf.call(/pdfform.cfm:55) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1082) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1006) at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:998) at lucee.runtime.tag.CFTag.doInclude(CFTag.java:319) at lucee.runtime.tag.CFTag.cfmlEndTag(CFTag.java:260) at lucee.runtime.tag.CFTag.doAfterBody(CFTag.java:207) at site.webapp.export_elevation.generatepdf_cfm$cf$2.call(/site/webapp/Export_Elevation/generatePDF.cfm:297) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1082) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1006) at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:987) at index_cfm$cf.call(/index.cfm:30) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1082) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1006) at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:213) at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:41) at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2810) at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2797) at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2768) at lucee.runtime.engine.Request.exe(Request.java:45) at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1109) at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:1066) at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:97) at lucee.loader.servlet.jakarta.CFMLServlet.service(CFMLServlet.java:52) at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:710) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:130) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:109) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:79) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:483) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:116) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:396) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:903) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1744) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:59) at java.base/java.lang.Thread.run(Unknown Source) Caused by: java.lang.IllegalStateException ... 78 more
Any thoughts on my last comment? Just trying to get basic image functionality working.
Hi
Yes. However I am in transit trying to get out of the Middle East. I am out of pocket for the moment.
@jclausen can you assist and create a jira issue please.
I just found a way to solve this by creating a template for each user so I’m not longer looking to use the library to put images on a PDF. I think that’s a key feature, and you might want to add some working examples in the docs. Good luck getting to safety!

