0 Replies Latest reply on Nov 11, 2010 8:38 AM by jtchivers

    Problems with cfpdfform and in-line styles in LiveCycle form fields

    jtchivers

      ColdFusion version: 8.0.1
      Update level: C:/ColdFusion8/lib/updates/chf8010004.jar
      Server OS: Windows Vista 64
      Web server: Apache

       

      I'm  using cfpdfform in ColdFusion 8 to read a Livecycle 8.2.1 pdf form  straight into the browser window, enter text into a field and  then submit the form back to the same CF page and use the submitted XML  to populate the same source form. The text field format is set to Rich Text in LiveCycle and allows multiple lines.

       

      When the form is submitted and the output is saved to an XML file, the file looks as follows (for example):

       

      <?xml version="1.0" encoding="UTF-8"?>
      <xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">
          <xfa:data>
              <topmostSubform>
                  <TextField1>
                      <body xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/" xmlns="http://www.w3.org/1999/xhtml" xfa:APIVersion="Acroform:2.7.0.0" xfa:spec="2.1">
                          <p style="margin-top:0pt;margin-bottom:0pt;text-valign:middle;text-align:center;font-family: 'Gill Sans MT';font-size:5pt;color:#ffffff">Here is some
                              <span style="xfa-spacerun:yes"> </span>
                              <span style="font-weight:bold">bold</span>
                              <span style="font-weight:normal">text.</span>
                          </p>
                      </body>
                  </TextField1>
              </topmostSubform>
          </xfa:data>
      </xfa:datasets>

       

      This is captured directly from the posted PDF object and saved straight out to file, as follows:

       

      <cfpdfform action="read" source="#PDF.content#" xmldata="myXMLData" />
      <cffile action="write" file="c:\temp\myXMLData.xml" output="#myXMLData#" charset="utf-8" nameconflict="overwrite">

       

      When this outputted XML is used as the basis for populating the same source LiveCycle form, like this...

       

      <cfpdfform action="populate" source="c:\temp\myLiveCycleForm.pdf" xmldata="c:\temp\myXMLData.xml" overwriteData="no" />

       

      I get the ColdFusion error 'An exception has occured in the processing of PDF forms.' The error occurs on the populate action above. Further error details are:


      java.lang.NullPointerException
          at coldfusion.pdf.XFADataXMLGenerator.getNumOfSameElementWithinNode(XFADataXMLGenerator.java :215)
          at coldfusion.pdf.XFADataXMLGenerator.setNodeValues(XFADataXMLGenerator.java:346)
          at coldfusion.pdf.XFADataXMLGenerator.createFormXMLData(XFADataXMLGenerator.java:144)
          at coldfusion.pdf.PDFForm.populateFields(PDFForm.java:267)
          at coldfusion.tagext.lang.PDFFormTag.doEndTag(PDFFormTag.java:287)
          at cfindex2ecfm1148555533.runPage(E:\WWWRoot\Examples\cfpdfform\index.cfm:25)
          at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:196)
          at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:483)
          at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
          at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:288)
          at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
          at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
          at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:27)
          at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)
          at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:2 8)
          at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
          at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
          at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
          at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
          at coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:126)
          at coldfusion.CfmServlet.service(CfmServlet.java:198)
          at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
          at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
          at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42 )
          at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
          at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
          at jrun.servlet.FilterChain.service(FilterChain.java:101)
          at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
          at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
          at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)
          at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
          at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
          at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
          at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
          at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
          at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

       

      If I post the PDF form without making any text in the field bold, I get the following XML output when I submit the PDF form:

       

      <?xml version="1.0" encoding="UTF-8"?>
      <xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">
          <xfa:data>
              <topmostSubform>
                  <TextField1>
                      <body xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/" xmlns="http://www.w3.org/1999/xhtml" xfa:APIVersion="Acroform:2.7.0.0" xfa:spec="2.1">
                          <p style="margin-top:0pt;margin-bottom:0pt;text-valign:middle;text-align:center;font-family: 'Gill Sans MT';font-size:5pt;color:#ffffff">Here is some normal text</p>
                      </body>
                  </TextField1>
              </topmostSubform>
          </xfa:data>
      </xfa:datasets>

       

      The key difference here is the absence of the span tag to do the in-line formatting. This XML works just fine when used to populate the PDF form, so the span tags appear to be causing the problem.

       

      Has anyone else encountered this problem and found a solution?