Seam-PDF Unable to Render Rich Text Copied from MS Office Products
aimee Jan 7, 2011 8:45 AMOur web app makes extensive use of the rich:editor component. Our end users paste text that they've copied from Office, Outlook, Excel, web pages, PDFs, etc., into those editors. The web app then generates a PDF of the data.
Issue:
p:text renders all of the data, including the embedded markup tags
p:text does not support escaping the markup tags
We tried using h:outputText (setting escape to false) surrounded by p:html tags, but then no data is rendered in the PDF. Same thing if we use s:formattedText
If the end user types into the rich:editor and uses the formatting buttons made available by the rich:editor to bold, bullet list, etc., seam-pdf renders the data just fine as long as we use h:outputText and set escape to false.
<h:outputText escape="false" value="#{data}" />
Is Seam PDF able to render complex
rich text? Do we have to use iText libraries and write code in a bean to generate the PDF? Or do we have to abandon Seam PDF and iText altogether in favor of something else?
Thanks in advance!
Example:
User copied this from an email into a rich:editor text box:
From: Smith, Bob Sent: Thursday, January 06, 2011 5:55 AM To: Doe, Jane P (ATTSI) Subject: FW: make number a hot link This link should work http://fakeUrl.com/app/pdf/pdfRequestAll.seam?requestId=400086&bypass=true I removed the cid field.
This is what is stored in the database and unable to be rendered as user-friendly text by seam-pdf:
<p class="MsoNormal" style="margin: 0in 0in 0pt; mso-outline-level: 1;"><strong><span style="font-size: 10pt; font-family: "Tahoma","sansserif& quot;;">From:</span></strong><span style="font-size: 10pt; font-family: "Tahoma","sans-serif";"> Smith, Bob <br /><strong>Sent:</strong> Thursday, January 06, 2011 5:55 AM<br /><strong>To:</strong> Doe, Jane P (ATTSI)<br /><strong>Subject:</strong> FW: make number a hot link</span></p> <p class="MsoNormal" style="margin: 0in 0in 0pt; mso-outline-level: 1;"> </p> <p><span style="font-size: 10pt; font-family: "Tahoma","sans-serif";"> <p class="MsoNormal" style="margin: 0in 0in 0pt;"><span style="color: #1f497d;"><span style="font-size: small; font-family: Calibri;">This link should work </span><a href="http://fakeUrl.com/app/pdf/pdfRequestAll.seam?requestId=400086&bypass =true"><span style="font-size: small; font-family: Calibri;">http://exceptions.att.com/TsseJ/pdf/pdfRequestAll.seam?requestId=400086&byp ass=true</span></a><span style="font-size: small;"><span style="font-family: Calibri;"> I removed the cid field. </span></span></span></p> </span></p>