1

i need to convert angular editors html out put to rtf form and render rtf to html while fetching rtf data form server.

  convert(){   
    let rtf = this.htmlToRtf.convertHtmlToRtf(this.html);
    console.log('rtf',rtf)

    console.log('rtfString',JSON.stringify(rtf))

    // const blob = new Blob([rtf], {type: "application/rtf;charset=utf-8"});
    // const link=window.URL.createObjectURL(blob);
    // window.location=link;
  }


  convertToPlain(rtf) {
    rtf = rtf.replace(/\\par[d]?/g, "");
    rtf = rtf.replace(/\{\*?\\[^{}]+}|[{}]|\\\n?[A-Za-z]+\n?(?:-?\d+)?[ ]?/g, "")
    return rtf.replace(/\\'[0-9a-zA-Z]{2}/g, "").trim();
}
``` but does not provide required result.
M.Mandal
  • 11
  • 2
  • Please include details of why this does not provide required result i.e. why https://stackoverflow.com/q/29922771 doesn’t answer your question – Andrew Allen Dec 15 '22 at 06:49
  • it omit the word or latter with bold or italic or other style associated with that.otherwise it is ok, but i need with style as i put in editor. – M.Mandal Dec 16 '22 at 08:20

0 Answers0