Page 1 of 1

Problem with image links when importing/exporting RTF &

Posted: Mon Jun 25, 2007 9:20 pm
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.

Posted: Tue Jun 26, 2007 7:41 am
by Sergey Tkachenko
Do you mean that value of this property is lost when you load RTF file?
Set RichView.RTFReadProperties.StoreImagesFileNames = True

Posted: Tue Jun 26, 2007 11:28 am
by simon-c
Sergey Tkachenko wrote:Set RichView.RTFReadProperties.StoreImagesFileNames = True
That was the setting I'd missed. Thank you.
--
Simon.