Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

RichText with HTML markup in PDF

MartinDetva
Level 2
Level 2

Hello

I've come to the point, when I need to display rich text with html markups in output PDF.

PDF is going to be printed and I don't want anything to be editable.

I've started with xsd schema for the xdp template, where particular element looks like this:

       <xs:element name="note">
               <xs:complexType>
                      <xs:simpleContent>
                           <xs:extension base="xs:string">
                                <xs:attribute ref="xfa:contentType" fixed="text/html"/>
                           </xs:extension>
                      </xs:simpleContent>
               </xs:complexType>
       </xs:element>

in xdp form, I am using TextField with RichText option switched on, value type: Read Only

as a test, xml data, which I am passing into it, looks like this:

<note>

     <body xmlns="http://www.w3.org/1999/xhtml">

          <b>Note</b>

          <a href='http://somepage.com'>homepage</a>

          <img src = 'pdficon.png'/>

     </body>

</note>

It comes from the html snippet, which is also displayed in java web application using the wicket framework, so no problem with that in web browser.

In general, it works, I am not getting any parsing errors or other exceptions from LC.

Now, my questions are:

1.hyperlink is displayed correctly in blue color and underlined, but it is not clickable ... is it because of the ReadOnly option?

2. Obviously, image is skipped. I don't expect that to be shown in textField, also there is not real path to that image, but I wonder, is it

possible to display it in some other way? Or, to be more precise, is it possible to interpret <img src... correctly in PDF?

3. I understand from some other thread in this forum, that it is not possible to paste html snippet into PDF directly?

Many thanks

   Martin

0 Replies
Abhinav_Sharma
Level 4
Level 4

I think you cant do it in PDF as of now. May be in future it would be available.

Thanks.

-

Abhinav

MartinDetva
Level 2
Level 2

Hi Abhinav

What my question your reply does apply to? Nr. 3?

   Martin