i use the function appendRTF for this type of rtf data :
- Code: Select all
exemple rtf :
{\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1036{\fonttbl{\f0\fnil\fcharset0 Arial;}{\f1\fnil\fcharset0 Times New Roman;}}{\*\generator Riched20 6.3.9600}\viewkind4\uc1 \pard\fs24 \b\i Le contrat joint \'e0 la convocation de la pr\'e9sente assembl\'e9e en l'\'e9tat.\par\b0\i0\f1\par\par}
my problem is in word directly in rtf mode see file wordoriginal.png
with spire.doc function appendRTF there is an error on char font see the result in file functionappendrtf.png
i use the code
- Code: Select all
Dim sectmp As Section = DocReceveur.AddSection()
sectmp.AddParagraph().AppendRTF(Codertfexemple)
Dim replacementFirstItem As ParagraphBase = sectmp.Paragraphs(0).Items.FirstItem
Dim replacementLastItem As ParagraphBase = sectmp.Paragraphs(sectmp.Paragraphs.Count - 1).Items.LastItem
Dim sel As TextBodySelection = New TextBodySelection(replacementFirstItem, replacementLastItem)
Dim part As TextBodyPart = New TextBodyPart(sel)
bookmarkNavigator.MoveToBookmark(ligneData(1).Trim(), True, True)
bookmarkNavigator.ReplaceBookmarkContent(part, True) '[b]i try TRUE and FALSE for the second param[/b]
....
i dump the result paragraph of appendRTF : sectmp.Paragraphs i don't find the arial font specified in rtf code...
i need the same word result with the appendRTF spire.doc .
ps i tested also with wordpad and it the same result than word.
thank's for your help
FH