WPCubed Product Support

How to get the 'object' for a wpoframe tag

Hi,

I have a routine that was processing some RTF files, that originally contained 'linked images' (using old StreamLoadEvent in WPTools 4), and after executing it in WPTools 5, without HTTPImageRequest event, the linked images now appears as a 'white box with red borders'. The files were already processed, and I need to 'restore' the linked images as a separate routine.

I could create the routine to 'restore the original linked image', doing some stringreplace code, but now I'm having a problem with the size (width / height) of the image itself. The image that is inside the RTF file may have different size of the original image (because the user decided to resize it), but I don't know how to get the size of the 'white box image'. I tried to use WPRichText.TextObjects list, but the image itself doesn't seems to be a textobject. I couldn't find a way to get its dimensions. Does anyone has an idea how to do this?

The 'white box' image has this rtf code:

{\*\wptools\wpomode0\wpoframe0{\*\wppicname{brasoes\\\\1.bmp}}{\*\wppicsource{brasoes\\1.bmp}}{110e190054575054656d7053617665546578744f626a48656c70657200545046301854575054656d7053617665546578744f626a48656c7065720007576964746854570325050848656967687454570348050c57726974655254464d6f6465070c776f624175746f6d617469630545787472610655547970653a31323b4e616d653a22627261736f65735c5c312e626d70223b536f757263653a5b5b627261736f65735c312e626d705d5d3b57696474683a313331373b4865696768743a313335323b577261703a303b064f626a546167020000003f3f3f00}}

And the 'desired rtf code' should be this:

{\*\wppicname{brasoes\\\\1.bmp}}{\*\wppicsource{brasoes\\1.bmp}}{\field{\*\fldinst{INCLUDEPICTURE "brasoes\\\\1.bmp" MERGEFORMAT \\d \\w2610 \\h885}}}

Thanks for your help

Alessandro

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

Hi,

without HTTPImageRequest

well, this event is exactly there to map the images to a new location. You get all the data You need here, most imprtant the "StreamName". The width/height was encoded into the hex data which is loaded into a new TWPObject and can be retrieved there.

Julian

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