Julian
Is there a way to get WPTools 6 to save html image tags as <img src="cid:.... rather than as just <img src="
Julian
Is there a way to get WPTools 6 to save html image tags as <img src="cid:.... rather than as just <img src="
Hi,
WPTools 6 incluides the MIME encoder which uses Synapse. Please check it out. It maybe already does what You need.
The unit WPIOHTML.PAS uses the $define ADDIMG_CID.
If this is defined it adds "cid:' to the file name.
Please take a look to this unit - it should be very clear what it does.
Julian
Thanks - that's what was needed
Julian
Just thinking about this. I'll be using WPTools to originate emails, and to write letters. For emails I want to embed the images so src=cid is what I want. Letters on the other hand just need to access the disk. What I'm building up to is a property might be better than a define.
Any thoughts on this??
Hi,
well , it is not really necessary.
From the code you can clearly see the flow the program takes:
First - here is you chance to update the name:
if txtobj.ObjType = wpobjImage then begin DontSave := FALSE; fnam := ''; PrepareImageforSaving(txtobj, DontSave, fnam); // execute event
Later it is written:
if fnam <> '' then
begin
{$IFDEF ADDIMG_CID}
if Copy(fnam ,1,4) <> 'cid:' then
fnam := 'cid:' + fnam;
{$ENDIF}
WriteString('<img src="');
WriteString(fnam);
WriteString('"');
ImageAlign;
Alles anzeigen
So, using OnPrepareImageforSaving You have the complete power :)
The OnPrepareImageForSaving event has a different parameter list
(RTFData: TWPRTFDataCollection; Writer: TWPCustomTextWriter; TextObject: TWPTextObj; var DontSave: Boolean);
so I presume you're suggesting setting TextObject.ObjRef.FileName