Html Export with resized images missing width and height

General TRichView support forum. Please post your questions here
Post Reply
Toni Santa
Posts: 4
Joined: Tue Nov 14, 2006 10:42 am

Html Export with resized images missing width and height

Post by Toni Santa »

Hi,
I use the TRichView-component to generate the html-body of Outlook messages. With latest update of the component the width and heigth attributes are no longer written. Now the html row looks like
<p class=rvps2><img alt="" style="width : 328px; height : 77px; vertical-align: bottom;" src="Mail127451_1"></p>
with previous version it was
<p class=rvps2><img alt="" width = 328 height = 77 style="width : 328px; height : 77px; vertical-align: bottom;" src="cid:Mail127451_1"></p>

So in Outlook the image is not sized to 328x77, but it is shown with the original dimension.
The html is created by
frmDBRichViewEdit.RichViewEdit1.InnerEditor.SaveHTMLToStreamEx(Stream, IncludeTrailingBackSlash(TempPath), '',
'Mail' + IntToStr(IDDocumento) + '_', '', '', '', [rvsoImageSizes]);

So i tried to set the ImageOptions of the component
frmDBRichViewEdit.RichViewEdit1.InnerEditor.HTMLSaveProperties.ImageOptions := frmDBRichViewEdit.RichViewEdit1.InnerEditor.HTMLSaveProperties.ImageOptions + [rvhtmlsioImageSizeAttributes];
but it seems this is ignored by the SaveHTMLToStreamEx

so i changed in RichView.pas, SaveHTMLToStreamEx, by adding a line
SavingData.ImageOptions := GetHTMLSaveProperties.ImageOptions

and so the width and heigth attributes are added to the hmtl-code.

Is there another way or could you fix this?

Best regards
Toni Santa
Sergey Tkachenko
Site Admin
Posts: 17805
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Html Export with resized images missing width and height

Post by Sergey Tkachenko »

SaveHTMLToStreamEx is a deprecated method. It is maintained only for a backward compatibility. It does not use HTMLSaveProperties; it uses only its parameters. I do not plan to change it, because it would affect existing projects.
Please use the new method SaveHTMLToStream instead.
Post Reply