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;
LeftIndent and LoadHtml issue
Just to have code more readable
Just to have code more readable
Code: Select all
procedure TForm1.SpeedButton1Click(Sender: TObject);
var
vStream: TMemoryStream;
s: TRVRawByteString;
begin
vStream := TMemoryStream.Create;
try
// init some data with Left Indent = 40 first
RichViewEdit1.Clear;
RichViewEdit1.Add('Test Line', 0);
RVStyle1.ParaStyles[0].LeftIndent := 40;
RVStyle1.ParaStyles[0].Standard := False;
RichViewEdit1.Format;
// save HTML to stream
RichViewEdit1.SaveHTMLToStreamEx(vStream, '', '', '', '', '', '', [rvsoInlineCSS, rvsoMiddleOnly]);
// RichViewEdit1.SaveHTMLToStreamEx(vStream, '', '', '', '', '', '', []);
// load HTML from stream
vStream.Position := 0;
SetLength(s, vStream.Size);
vStream.ReadBuffer(PRVAnsiChar(s)^, Length(s));
RvHtmlImporter1.LoadHtml(s);
RichViewEdit1.Format;
finally
vStream.Free;
end;
end;
-
- Site Admin
- Posts: 17571
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
This is a bug in the RvHtmlImporter. A fixed version is uploaded in http://www.trichview.com/resources/html ... import.zip
PS: for better results, I recommend using rvHtmlViewImporter instead of RvHtmlImporter, you can find it on http://www.trichview.com/resources/
PS: for better results, I recommend using rvHtmlViewImporter instead of RvHtmlImporter, you can find it on http://www.trichview.com/resources/
Still not working
Unfortunately RvHtmlImporter.LoadHtml still not working. Left Indent (Bold, Italik Font styles as well) are ignored by the HtmlImporter
There is an example of HTML which I have
I was also not able to install RvHtmlImporter component (I have D2007).
Files "Htmlsubs.pas" and "HTMLUn2.pas" form Step 2 of the Installation Guide are not included in any RichView projects. Step 4 is not clear - what does it mean "Install HTML Viewer Components"?
Eventually I have an Error "[DCC Error] rvHtmlViewImportD2007.dpk(32): E2202 Required package 'FrameViewer2007' not found"
Thank you
There is an example of HTML which I have
Code: Select all
<p style=" text-align: left; text-indent: 0px; padding: 0px 0px 0px 0px; margin: 0px 0px 0px 20px;"><span style=" font-size: 10pt; font-family: 'Arial', 'Helvetica', sans-serif; font-style: normal; font-weight: bold; color: #000000; background-color: transparent; text-decoration: none;">Test Line</span></p>
Files "Htmlsubs.pas" and "HTMLUn2.pas" form Step 2 of the Installation Guide are not included in any RichView projects. Step 4 is not clear - what does it mean "Install HTML Viewer Components"?
Eventually I have an Error "[DCC Error] rvHtmlViewImportD2007.dpk(32): E2202 Required package 'FrameViewer2007' not found"
Thank you
-
- Site Admin
- Posts: 17571
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
RvHtmlImporter does not understand CSS. The only exception is CSS saved using SaveHTMLEx method without rvsoInlineCSS option.
RvHtmlViewImporter imports HTML from THTMLViewer. It must be installed before, download it from http://www.pbear.com
It is freeware with source code.
HTML must be loaded in THTMLViewer, then imported in TRichView using TRvHtmlViewImporter.
RvHtmlViewImporter imports HTML from THTMLViewer. It must be installed before, download it from http://www.pbear.com
It is freeware with source code.
HTML must be loaded in THTMLViewer, then imported in TRichView using TRvHtmlViewImporter.