I've been able to get simple forms to export as a PDF and added as an attachment to emails.  I've even been able to customise them and make them really useful for the purpose we're using them for.  However on any complex form (the ones I really need it for) I get an error on the <br> tag that I can't see and don't know where it is.

Error Message
INFO  15 May 2014 16:19:10 org.joget.plugin.enterprise.ExportFormEmailTool  - ExportFormEmailTool: Generate PDF start.
ERROR 15 May 2014 16:19:10 org.joget.apps.form.service.FormPdfUtil  - org.xml.sax.SAXParseException; lineNumber: 108; columnNumber: 15; The element type "br" must
be terminated by the matching end-tag "</br>".
org.xml.sax.SAXParseException; lineNumber: 108; columnNumber: 15; The element type "br" must be terminated by the matching end-tag "</br>".
	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:121)
	at org.joget.apps.form.service.FormPdfUtil.createPdf(FormPdfUtil.java:64)
	at org.joget.plugin.enterprise.ExportFormEmailTool.createPdf(ExportFormEmailTool.java:94)
	at org.joget.plugin.enterprise.ExportFormEmailTool$1.run(ExportFormEmailTool.java:212)
	at java.lang.Thread.run(Thread.java:701)
ERROR 15 May 2014 16:19:10 org.joget.plugin.enterprise.ExportFormEmailTool  - java.lang.NullPointerException
java.lang.NullPointerException
	at java.io.ByteArrayInputStream.<init>(ByteArrayInputStream.java:106)
	at org.joget.plugin.enterprise.ByteArrayDataSource.getInputStream(ByteArrayDataSource.java:22)
	at org.apache.commons.mail.MultiPartEmail.attach(MultiPartEmail.java:393)
	at org.joget.plugin.enterprise.ExportFormEmailTool$1.run(ExportFormEmailTool.java:216)
	at java.lang.Thread.run(Thread.java:701)

Here is the Preview (the nearest I can get to the code being converted) and there are no <br> tags anywhere.

HTML Code
        <div id="" class="subform-column" style="width: 49%" >
        <h3 class="subform-column-label">

        </h3>
        <div class="subform-cell" >
    <label class="label">Date Raised <span class="subform-cell-validator"></span></label>
        <span>15-May-2014 16:05</span>
        <input id="field43_job_details_contractor_dateRaised" name="field43_job_details_contractor_dateRaised" type="hidden" value="15-May-2014 16:05" />
</div>

        <div class="subform-cell" >
    <label class="label">Damage Details <span class="subform-cell-validator"></span></label>
        <div class="subform-cell-value">
            <div>Attempted Break-in</div>
            <input id="field43_job_details_contractor_damageDetails" name="field43_job_details_contractor_damageDetails" type="hidden" value="Attempted Break-in" />
        </div>
        <div style="clear:both;"></div>
</div>

I can't find where the error is occurring.

Any thoughts?

Hugh

  • No labels

2 Comments

  1. I've been looking into this and although I've not been able to track down why this happened, I have been able to rewrite the forms to create as needed.

    I think it's an issue with a form, within a subform with a header but I've not had time to get to the bottom of it.

    The good news is the re-write worked and we're back on course.

    Hugh

    1. Hi Hugh,

      The initial issue is that the PDF generator uses an XML parser that requires well-formed XHTML, so custom HTML tags need to be properly closed. So instead of using <br>, it should be <br />

      Cheers!

      Julian