Chris, Glad I could help. Cheers
On Wed, Sep 19, 2012 at 6:29 PM, Chris <h_chris...@yahoo.com> wrote: > Teddy, > > Thanks for the reply. > > I used ColdFusion to remove off the HTML formatting using > reReplaceNoCase(data, regex, "", "all") where regex = "<(.|)*?>" and it > worked fine. > > I appreciate your advice and time. > > ------------------------------ > *From:* Teddy R. Payne <teddyrpa...@gmail.com> > *To:* discussion@acfug.org > *Sent:* Tuesday, September 18, 2012 2:13 PM > *Subject:* Re: [ACFUG Discuss] Converting HTML formatted text to regular > text in Coldfusion 9 > > Chris, > Do you need to store the style formatting for "Test Record"? > > If "Test Record" needs to look differently across different mediums (Flex, > PDF), have the style formatting defined in Flex and the PDF and just store > the actual data inside of the database. > > If you need to capture the formatting on the text for display elsewhere, > you may want to use ColdFusion to strip off the formatting depending on > your need. > > You could have some methods in either Flex or CF to perform some custom > calls like FormatRecord("plaintext" or "html") and then you return either > the stripped out data or return the original formatting that was entered. > > I am not sure there is a single CF function that will just return the data > in between the all of the formatting, but you could probably just use > REReplace() to use regular expressions to get to the core test record data. > > Cheers, > Teddy > > On Tue, Sep 18, 2012 at 1:48 PM, Chris <h_chris...@yahoo.com> wrote: > > > An application consists of Flex as front end, Coldfusion 9 as middle tier > and MySQL 5 as the back end. > > A MySQL table contains some fields which contain HTML formatting. So, if a > field has value string "Test Record" it is stored as > <TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Arial" SIZE="12" > COLOR="#0B333C" LETTERSPACING="0" KERNING="0">Test Record<FONT > SIZE="8"></FONT></FONT></P></TEXTFORMAT> > in the MySQL table > > Now, this field's value is being printed in a PDF document as > > <cfdocument format="pdf" filename="#report_filename_format#" > orientation="landscape" > overwrite="yes" > marginbottom="0" marginleft="0" marginright="0" margintop="0" > pagetype="legal"> > > > <tr> > <td width="20%" style="background-color:##CCCCCC; font-weight:bold; > text-transform:uppercase; vertical-align:top;"> > Value > </td> > <td width="80%">#printrecord.field_value#</td> > </tr> > > Since, the field value is stored with HTML formatting, the space taken is > more and there is no > control about the printed text's font type and font size. > > 1. Is there any function in Coldfusion 9 which can convert the field's > value to a regular text(without the HTML formatting) so that if "Test > Record" would print the same regardless of whether it was stored as font > size 10 or font size 30? > > 2. I am thinking of one way is to get the record being printed in a Flex > application, use field.text property of a TextArea control(in Flex) > to convert to regular text, then pass the converted value to Coldfusion > for printing in the PDF document. Are there other better options? > > Any suggestions would be appreciated. > > > > ------------------------------------------------------------- > To unsubscribe from this list, manage your profile @ > http://www.acfug.org?fa=login.edituserform > > For more info, see http://www.acfug.org/mailinglists > Archive @ http://www.mail-archive.com/discussion%40acfug.org/ > List hosted by FusionLink <http://www.fusionlink.com/> > ------------------------------------------------------------- > > > > > > ------------------------------------------------------------- > To unsubscribe from this list, manage your profile @ > http://www.acfug.org?fa=login.edituserform > > For more info, see http://www.acfug.org/mailinglists > Archive @ http://www.mail-archive.com/discussion%40acfug.org/ > List hosted by FusionLink <http://www.fusionlink.com> > -------------------------------------------------------------