Expand my Community achievements bar.

Unable to print HTML data

Avatar

Former Community Member

Hi,

I have the following text, which I want to print in HTML format. I created a textfield and set the properties as XHTML and Richtext. But its not displaying in HTML format. Rather its displaying the whole text as it is on to the screen.

<TEXTFORMAT LEADING="2"><LI><FONT FACE="Arial,sans-serif" SIZE="11" COLOR="#000000" LETTERSPACING="0"


KERNING="0">Hello world</FONT></LI></TEXTFORMAT>

Please can you suggest if I have to do additional settings?


Regards,

Charli

4 Replies

Avatar

Level 10

Hi,

Try changing the textfield back to plain text.

Good luck,

Niall

Assure Dynamics

Avatar

Former Community Member

Hi Niall,

I tried that way and other combinations also. But it didnt work.

The same text if I copy in notepad and save as a .html file,  it looks good.

Any other options?

Thanks,
Charli

Avatar

Level 10

Hi Charli,

XFA Forms only supports a subset of HTML tags, and LI is not one of them.  You can do something similar with a text-indent, as explained in the rich text chapter in http://partners.adobe.com/public/developer/en/xml/xfa_spec_3_1.pdf .

If this text is something dynamic being loaded from the server then you can use an XSLT to convert it, maybe in the initialise event of the containing subform.  Something like;

var stylesheet = <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:output method="xml" indent="yes"/>
      <xsl:template match="TEXTFORMAT">
        <body xmlns="http://www.w3.org/1999/xhtml" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">
          <xsl:apply-templates/>
        </body>
      </xsl:template>
      <xsl:template match="LI">
        <p style="line-height:22pt;text-indent:-7pt;">
          <span style="font-size:11pt">• </span>
          <xsl:value-of select="./*/text()"/>
        </p>
      </xsl:template>
    </xsl:stylesheet>;

var richText = dataNode1.applyXSL(stylesheet.toXMLString());

Good luck, Bruce

Avatar

Former Community Member

Hi Bruce,

Yeah, we did the same. Transforming the text before printing the form. It works.

Thanks for the suggestion.

Ravikanth