tbluemel / rtf.js

Render RTF documents in HTML.
MIT License
147 stars 35 forks source link

How to fetch email id from rtf file and render in html #60

Closed harmeetkhl38 closed 4 years ago

harmeetkhl38 commented 4 years ago

how to fetch email id from rtf file and render in html

zoehneto commented 4 years ago

I need some additional information to answer that. Do you want the email address from the meta information or is it contained within the text? Ideally also provide a sample file showin what you want to do.

harmeetkhl38 commented 4 years ago

I need some additional information to answer that. Do you want the email address from the meta information or is it contained within the text? Ideally also provide a sample file showin what you want to do.

in rtf file their is email id present along with text. I need to render the content of the file in html. Able to render all other text along with sonts and styles but email id is not coming. Library seems like just emitting that emailid

zoehneto commented 4 years ago

I tried to reproduce the issue but it worked for me. You'll have to provide a sample file to debug this further.

muditgoel2016 commented 4 years ago

image

muditgoel2016 commented 4 years ago

You can see above, ths is a copy paste from outlook to a software using rtf.js library..Now I think you understand the issue faced by Harmeet.

zoehneto commented 4 years ago

I can see the issue but as I don't have outlook I'll still need a sample file to debug this issue.

muditgoel2016 commented 4 years ago

Sure....you can have this file I have attached. Extract it to access bcd.rtf that will get you the issue

bcd.zip

zoehneto commented 4 years ago

Just for reference: the document uses a sub destination inside \fldinst and \fldrslt (to support both right to left and left to right text), which breaks our field parsing. We probably have to expand our field parsing logic to make it more robust here (not sure this is valid according to the spec, but what can you do).

muditgoel2016 commented 4 years ago

Is it what is also causing the issue with email etc not appearing? Else, is that separate? Moreover, any plans on the horizon for fixing it? Also, I have recently checked even hyperlinked urls go missing after the content is through rtf.js.

zoehneto commented 4 years ago

Yes, that is the cause of the issue. It is also what causes your hyperlink issues, as those use the same underlying feature. I hope to fix this issue as soon as I have time but I can't say when exactly.

zoehneto commented 4 years ago

@muditgoel2016 @harmeetkhl38 I have fixed the issue (at least for the sample file you provided) in PR #61 . Could you please test whether this solution solves your problem?

muditgoel2016 commented 4 years ago

@muditgoel2016 @harmeetkhl38 I have fixed the issue (at least for the sample file you provided) in PR #61 . Could you please test whether this solution solves your problem?

Yes, it fixes for the use-cases I had mentioned. Thank-you very much!