Problem with image links when importing/exporting RTF &

General TRichView support forum. Please post your questions here
Post Reply
simon-c
Posts: 11
Joined: Mon Jun 25, 2007 9:13 pm

Problem with image links when importing/exporting RTF &

Post by simon-c »

I've followed one of your examples elsewhere for saving an image as a link. The image is inserted into RVEdit and when the RTF is saved I trap OnSaveItemToFile, use RVData->GetItemExtraStrProperty(ItemNo,rvespImageFileName... to get the filename and write out RTF with

OutStr="{\\field{\\*\\fldinst INCLUDEPICTURE \""+Loc+"\" \\\\d }}";

This works great.

When the RTF is loaded back in to RVEdit with LoadRTFFromStream I trap OnImportPicture, load the picture passed through in Location and all is well.

The problem then comes that if the user saves this file as HTML when I trap OnHTMLSaveImage the original link is not available in rvespImageFileName so at this point the image is lost.

I tried setting rvespImageFileName myself during OnImportPicture, but I can't figure out which item number to set it on, as ItemNo isn't passed through to this call.

Is there any way to fix this issue?

Many thanks
--
Simon.
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Do you mean that value of this property is lost when you load RTF file?
Set RichView.RTFReadProperties.StoreImagesFileNames = True
simon-c
Posts: 11
Joined: Mon Jun 25, 2007 9:13 pm

Post by simon-c »

Sergey Tkachenko wrote:Set RichView.RTFReadProperties.StoreImagesFileNames = True
That was the setting I'd missed. Thank you.
--
Simon.
Post Reply