Saving embedded RTF images as HTML

  • Hi,

    I posted this question a while back - Upgrading from v4 to v6: Equivalents.

    I managed to migrate most of it all over, however, I am now stumped with a section which I had working in v4 but can't seem to get it to work in v6.

    Here is the V4 code (Delphi 2010):

    The editor would correctly export the images to HTML as img elements. However, I can't quite seem to get this to work in v6.

    Could someone help me translate the above v4 code into V6 code.

    Thanks

    • Offizieller Beitrag

    Hi,

    a) instead of TWPRichText.Create(nil) please use WPCustomRTFEdit.CreateDynamic. If you do this, You can format and print the text if necessary (V4 could not). When saving tables it is important to first format the text with ReformatAll.

    b) HTMLFilePath does not ecist anymore.

    You nneed to encode this information into the "formatstring". This is the string which can be passed to SaveToStream.

    Use the string

    'HTML-imgpath:"...."'


    -> This property is set using the -imgpath:"...." option. If used, the HTML writer will automatically save all images into this directory