Showing Dynamic Image in PDF [error: Premature end of File]

0
I'm building a form and showing a picture on it, using the RichTextViewer widget to do so. The attribute I'm connecting to it, is a string attribute, retrieving the image based on it's name: IMG src= "ui/images/icons/MyFirstModule$' + toString($CreditRequest/Decision) + '.png". This works perfectly on the form. However when I create a PDF of this form, using Document Template, and using a Dynamic Label with the setting "render HTML = true", I'm getting the following error: lh: Error processing custom XSL content at MyFirstModule.GeneratePDF ( : 'Generate PDF (.pdf) document using template 'PDF_Standard'') Advanced stacktrace: at mA.a(SourceFile:188) Caused by: com.mendix.systemwideinterfaces.MendixRuntimeException: Error processing custom XSL content at kF.a(SourceFile:143) Caused by: org.xml.sax.SAXParseException: Premature end of file. at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124) at kF.a(SourceFile:131) at kF.a(SourceFile:79) at kD.a(SourceFile:322) at kM.a(SourceFile:70) at kD.a(SourceFile:322) at kM.a(SourceFile:70) at kD.a(SourceFile:322) at kM.a(SourceFile:70) at kD.a(SourceFile:322) at kC.a(SourceFile:33) at kD.a(SourceFile:322) at kM.a(SourceFile:70) at kD.a(SourceFile:322) at kC.a(SourceFile:33) at kD.a(SourceFile:322) at kD.a(SourceFile:130) at kx.a(SourceFile:81) at kv.a(SourceFile:89) at kv.a(SourceFile:56) at ln.a(SourceFile:110) at mA.a(SourceFile:73) at mz.executeAction(SourceFile:101) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:48) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:435) at hk.b(SourceFile:156) at com.mendix.core.Core.execute(SourceFile:212) at gd.execute(SourceFile:184) at iI.a(SourceFile:311) at iI.a(SourceFile:240) at iI.processRequest(SourceFile:179) at iL.a(SourceFile:71) at com.mendix.core.MxRuntime.processRequest(SourceFile:856) at com.mendix.m2ee.server.handler.RuntimeHandler.handle(RuntimeHandler.java:43) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:113) at org.eclipse.jetty.server.Server.handle(Server.java:334) at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:559) at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1007) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:747) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:209) at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:406) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:462) at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436) at java.lang.Thread.run(Thread.java:662) Does anybody know what I'm doing wrong, and how to circumvent this issue?
asked
1 answers
0

Try to set the Document Generator lognode to trace and see what exactly it's trying to render here (including all < and > signs)

The problem seems to be that this isn't proper XHTML, the image tage should be closed, i.e. <img src="http://blabla" />, notice the last slash.

Additionally, the files in the icons folder are not .png files as you hardcoded but .gif files.

answered