Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I know what part of RTF syntax is wrong

Tags:

c#

an RTF is getting built and passed into some methods and finally getting passed to a text editor but something is wrong because the editor cannot parse it and instead of the correct text - NewYork in this case- it will show the whole rtf text but I have problem with finding out what is actually wrong with this RTF so maybe I can narrow it down and find out where is the place in code that is messing up the rtf tags, in my example it looks like this:

"{\rt\plain\f0\fs24 f1\ansi\deff0{\fonttbl{\f0\fswiss Microsoft Sans Serif;}{\f1\fswiss Tahoma;}}\deflang2057\deflange2057 \plain \f0 \fs24 \cb2 NewYork \plain \f0 \fs24 \cb2}"

like image 434
Bohn Avatar asked Dec 11 '25 21:12

Bohn


1 Answers

Should start with \rtf1 and you had a stray f1 that should have been \f1.

{\rtf1\plain\f0\fs24 \f1\ansi\deff0{\fonttbl{\f0\fswiss Microsoft Sans Serif;}{\f1\fswiss Tahoma;}}\deflang2057\deflange2057 \plain \f0 \fs24 \cb2 NewYork \plain \f0 \fs24 \cb2}"
like image 64
dee-see Avatar answered Dec 14 '25 10:12

dee-see



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!