WPCubed Product Support

LayoutMode problem

Hi,

I have a situation where I want to always show the header and footer (ie Layout mode set to wplayFullLayout), but when I save the document I want to embed the images in to the document. The only way I have been able to do this is to set the Layout Mode to wplayLayout and then Save the document.

So when I try to save a document I do this:

RTFText.LayoutMode := wplayLayout; //want to save the images
RTFText.SaveToFile(sFile, False, 'RTF-nomergefields'); //save the RTF doc
RTFText.LayoutMode := wplayFullLayout; //want to see the H + F info again

But the above does not seem to save the images in the document. It is almost like it doesn't recognize that the Layout mode has changed and needs to call OnPrepareImageForSaving etc.

Am I doing something wrong?

I am using 5.35.3.

Thanks,

Luke.

#1 ♥ 0
5.1k Views 2 users read 2 min
support

Hi,

the layoutmode is not connected to the save code.

Usually the images will always included. If thy are linked you might try 'RTF-AlwaysEmbed,-nomergefields' to make sure they are embedded with the binary data.

Also see the property WriteObjectMode. wobRTF should be used for best compatibility.

Julian

#2 ♥ 0

Thanks Julian,

Are there any design time properties that need to be also set? I tried what you suggested without any luck.

Regards, Luke.

#3 ♥ 0
support

Hi,

There must be someting specialwith your text. Please save as *.WPT file and mail it to me.

The designtime property which affect image saving is

property WriteObjectMode.

possible values are
wobStandard,
wobRTF,
wobStandardAndRTF,
wobDontSaveImages,
wobStandardNoBinary,
wobRTFNoBinary

It should be set to wobRTF or wobRTFNoBinary.

Regards,
Julian

#4 ♥ 0

Hi Julian,

I was able to get it to work in the end. If I went into the RTFText property of the TWPRichText at design time and then click OK (entering no text), it seems to work from now on. Previously there was no document in design time so this has seemed to have fixed it.

Thanks, Luke.

#5 ♥ 0
This category is archived. No new posts are possible.