Image in binary stops export to RTF without error

  • Hi WPTools team,

    I'm hoping very much you can help me with a little problem I'm having.

    I've been tasked with finding out why images don't export in the format RTF.

    I don't know why but the RTF file is tructated to the beginning of the binary image data.

    \bin is written with the size of the binary stream, then nothing else is written to the rest of the file

    There are no exceptions, the file is just tructated.

    I checked to see if there is data is in the stream and it seems good.

    I tried changing the source to save into hex and that seems to work, though I don't know how to configure the library to do that without my hardcoded change.

    In hex there's also the problem that the image is saved twice and I can't seem to figure out the logic behind this behaviour.

    Our system uses WPTools 6.13.3, which I'm aware is a very old version now.

    The export of the binary image data into the RTF file is done from the method TWPRTFWriter.WriteObject in WPIOWriteRTF.pas.

    AllowBinary is calculated to be true, ImageObj.WriteRTFMode = wobBoth, and RTFDataCollection.WriteObjectMode = wobRTFNoBinary.

    The first binary save is on the line WriteStream(bin, false); (3497) and the second just after with the call ImageObj.WriteRTFData(Self, txtobj, AllowBinary, LinkedToFile); (3527)

    So I'm wondering if you either have some idea for the problem of saving the binary image data or why the image is saved twice.

    Thank you very much!