I am trying to display an RTF file (that was created in a legacy system) in a new WPF application and have run into some difficulty. The old RTF file contains a picture formatted as a binary jpegblip which, when read into the RichTextBox, causes this exception:
Unrecognized structure in data format 'Rich Text Format'. Parameter name: stream
I reduced the file down to the bare minimum to isolate the problem and ended up with the following opening line (the binary data has been removed for this post):
{\rtf1{\pict\picw2700\pich2700\picwgoal2700\pichgoal2700\jpegblip\bin9889
This still caused an exception so I converted the binary data to hex and created a new file with the opening line:
{\rtf1{\pict\picw2700\pich2700\picwgoal2700\pichgoal2700\jpegblip
The file with the hex data in it was displayed correctly by the control.
Has anyone been able to load a file containing binary picture data into the RichTexBox control, or failing that, is there a difinitive statement as to what the RichTextBox supports from the RTF specification?