LeftIndent and LoadHtml issue
Posted: Thu Apr 23, 2009 6:51 pm
Hi all,
I ‘m trying to save HTM to stream and load the same HTML from stream.
To save data I’m using SaveHTMLToStreamEx , to load -TRvHtmlImporter.LoadHtml.
LeftIndent disappeared.
When I save this HTML to file and load it with IE, Indent works fine.
Is it possible to have this working (may be some other way)?
Thank you.
There are simple test example:
procedure TForm1.SpeedButton1Click(Sender: TObject);
var
vStream: TMemoryStream;
s: TRVRawByteString;
begin
vStream := TMemoryStream.Create;
try
RichViewEdit1.Clear;
RichViewEdit1.Add('Test Line', 0);
RVStyle1.ParaStyles[0].LeftIndent := 40;
RVStyle1.ParaStyles[0].Standard := False;
RichViewEdit1.Format;
RichViewEdit1.SaveHTMLToStreamEx(vStream, '', '', '', '', '', '', [rvsoInlineCSS, rvsoMiddleOnly]);
// RichViewEdit1.SaveHTMLToStreamEx(vStream, '', '', '', '', '', '', []);
vStream.Position := 0;
SetLength(s, vStream.Size);
vStream.ReadBuffer(PRVAnsiChar(s)^, Length(s));
RvHtmlImporter1.LoadHtml(s);
RichViewEdit1.Format;
finally
vStream.Free;
end;
end;
I ‘m trying to save HTM to stream and load the same HTML from stream.
To save data I’m using SaveHTMLToStreamEx , to load -TRvHtmlImporter.LoadHtml.
LeftIndent disappeared.
When I save this HTML to file and load it with IE, Indent works fine.
Is it possible to have this working (may be some other way)?
Thank you.
There are simple test example:
procedure TForm1.SpeedButton1Click(Sender: TObject);
var
vStream: TMemoryStream;
s: TRVRawByteString;
begin
vStream := TMemoryStream.Create;
try
RichViewEdit1.Clear;
RichViewEdit1.Add('Test Line', 0);
RVStyle1.ParaStyles[0].LeftIndent := 40;
RVStyle1.ParaStyles[0].Standard := False;
RichViewEdit1.Format;
RichViewEdit1.SaveHTMLToStreamEx(vStream, '', '', '', '', '', '', [rvsoInlineCSS, rvsoMiddleOnly]);
// RichViewEdit1.SaveHTMLToStreamEx(vStream, '', '', '', '', '', '', []);
vStream.Position := 0;
SetLength(s, vStream.Size);
vStream.ReadBuffer(PRVAnsiChar(s)^, Length(s));
RvHtmlImporter1.LoadHtml(s);
RichViewEdit1.Format;
finally
vStream.Free;
end;
end;