Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

RichText with HTML markup in PDF

Avatar

Former Community Member

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

3 Replies

Avatar

Level 4

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

Thanks.

-

Abhinav

Avatar

Former Community Member

Hi Abhinav

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

   Martin