There is a requirement that we need to render rich text of html in our adobe form. As we all know that adobe doesn’t know HTML but we may need to render HTML tags, for the same requirement follow below steps.

Step 1). Passing HTML to our form and set DOCPRAM-DYNAMIC = ‘X’.

Untitled.png

I created one Exporting parameter to pass my HTML rich text. You can get your HTML from SO10 also, and assign to Exporting parameter of your adobe FM.

Step 2). Create field in adobe form and set Field formate as Rich Text and bind with R_HTML.

Untitled.png  Untitled.png

Step 3). Then Test.

Untitled.png

Not expected output.

Step 4). Now add below javascript on docClose event of field.

Untitled.png

var envelope = "<?xml version='1.0' encoding='UTF-8'?>" +

  "<exData contentType='text/html' xmlns='http://www.xfa.org/schema/xfa-template/2.8/'" +

  "><body xmlns='http://www.w3.org/1999/xhtml' xmlns:xfa='http://www.xfa.org/schema/xfa-data/1.0/' " +

  "xfa:APIVersion='Acroform:2.7.0.0' xfa:spec='2.1'>" +

  "<p>"+ this.rawValue +"</p></body></exData>";

this.value.exData.loadXML(envelope,1,1);

Step 5). Now Test.

Untitled.png

Hope this helps.

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

    1. harish vyas

      Hi Roger,

      As per my understanding you have to use XSLT transformation to convert <STRONG> and <BLOCKQUOTE> tags to be compatible with ADOBE.

      BlockQuote

      <xsl:template match=”blockquote”>
      <p/>
      <span style=”xfa-tab-count:1″/>
      <xsl:for-each select=”ancestor::blockquote”>
      <xsl:text>;    </xsl:text>
      </xsl:for-each>
      <xsl:value-of select=”.”/>
      <p/>
      </xsl:template>

       

      Strong

      <xsl:template match=”strong”>
      <b>
      <xsl:apply-templates/>
      </b>
      </xsl:template>

       

      Regards,

      Harish

       

      (0) 

Leave a Reply