1 Reply Latest reply on Mar 14, 2011 6:20 AM by Ranganathan Kaliyur Mannar

    rich:editor and word doc

    Ranganathan Kaliyur Mannar Newbie
      Hi,
      I have a requirement to display a chapter in a book and save it too - saving as a CLOB works fine.
      I also have a requirement to email the chapter as a ms-word doc attachment. Is there a way to do it? I have tried to email it by reading the data and converting it to bytes, like: (i.e calling String.toBytes):

      <m:attachment value="#{book.chapter.asBytes}" contentType="application/doc">

      but, this sends the email as an attachment - but, when I try to open the email, it is not considered as a word doc. At best, it is seen as an html only (when opened in ms-office).

      Is there a way to create this as a word doc and email?

      Thanks,
      Ranga.
        • 1. Re: rich:editor and word doc
          Ranganathan Kaliyur Mannar Newbie

          Hi,
          rich:editor has a 'Paste From Word' option and that is working ok - I have to copy from word document and use the 'paste as word' button to insert into the rich editor. Then, I save the contents as BLOB. While reading back I derectly email it as attachment with value as the bytes read from the database.


          It is half-working. This time the attachment does go as a word doc and seen as one - however, the formatting changes quite a bit which is not ideal.