Page 1 of 1

AddPictureEx with metafile, unicode shown as question marks

Posted: Tue Mar 30, 2010 11:34 am
by alex-beka
Hi,

i have the problem that the generated .rtf file is showing question mark letters instead of unicode(cyrillic, japanese, chinese letters); has AddPictureEx Problems with metafiles including unicode or is it the SaveRTF method?

Code: Select all

mf := TMetaFile.Create;
mf.LoadFromFile('metafile.wmf');
richViewEdit.AddPictureEx('Script', mf, pCenter, rvvaBaseline);
richViewEdit.SaveRTF('report.rtf', false)
the orginal metafile (in the software IrfanViewer the metafile and the unicode text are shown correctly):
http://www.beka-consulting.com/assets/CAST/metafile.wmf

see the difference, question marks, in the generated rtf file: http://www.beka-consulting.com/assets/CAST/report.rtf

thanks in advance,
regards,
Alex

Posted: Wed Mar 31, 2010 6:03 pm
by Sergey Tkachenko
Exclude rvrtfSaveEMFAsWMF from RTFOptions property.

Pro: MS Word or TRichView will be able to load this metafile with all Unicode text.
Contra: some less capable applications (such as WordPad, at least, in WinXP), will not be able to load this picture at all.