TRichviewEdit: Unable to read exported rtf files/streams

General TRichView support forum. Please post your questions here
Post Reply
Mafi
Posts: 9
Joined: Mon Feb 18, 2008 10:15 am

TRichviewEdit: Unable to read exported rtf files/streams

Post by Mafi »

I'm using the TRichview 1.9.48, D5 and have some problems in reading *.rtf files/streams via the methods LoadRTF and LoadRTFFromStream (reports an exception: "invalid bitmap" in file rvrtf.pas, line 3149, "LoadGraphic(gr);").

All rtf-files and -streams are generated via the RvHtmlImporter component (converting user generated HTML-emails to rtf) and the methods SaveRTF and SaveRTFToStream of the TRichviewEdit component, but for some of them, the output is no more readable for the TRichviewEdit component. The directly converted document will be displayed in the corresp. TRichviewEdit (which is directly linked to the RvHtmlImporter) and looks ok.

All components have no special property settings.

Please can I attach a generated *.rtf anywhere to this message, so it's easier for you to reproduce the error.


Thanks
Mafi
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Please send them to svt@trichview.com
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I received this file.
The problem is caused by a zero-size bitmap:
{\pict\dibitmap0\wbmwidthbytes0\picw0\pich0\picwgoal0\pichgoal0 }

Fix: open RVRTF.pas, find the procedure LoadGraphic(var gr: TGraphic), add in case:

Code: Select all

        rtf_pict_DIB:
          if FPicture.FData.Size>sizeof(TBitmapFileHeader) then begin
            FPicture.FData.Position := 0;
            gr.LoadFromStream(FPicture.FData);
          end;
Post Reply