Page 1 of 1

rvHtmlImporter style indent

Posted: Tue May 10, 2022 10:30 pm
by jgkoehn
Greetings
Is the following tag supported in the rvHtmlImporter?

Code: Select all

<p style="text-indent: 40px">This text is indented.</p>
Mainly this portion

Code: Select all

style="text-indent: 40px"
If not, or in another way is there a better place to look for more info on rvHtmlImporter?

Re: rvHtmlImporter style indent

Posted: Wed May 11, 2022 11:31 am
by Sergey Tkachenko
TrvHtmlImporter does not support CSS in HTML (except for a very limited set of CSS attributes).
For HTML containing CSS formatting, use TrvHtmlViewImporter instead. However, it is available only for VCL version of TRichView.
TrvHtmlViewImporter requires a free third-party component THTMLViewer https://github.com/BerndGabriel/HtmlViewer.

Plans for future:
I do not plan to improve THtmlImporter. Instead, I plan to implement TRichView.LoadHtml method from scratch. I plan to implement it in this year, but I cannot guarantee it.

Re: rvHtmlImporter style indent

Posted: Fri May 13, 2022 6:49 pm
by jgkoehn
Greetings Sergey,
Ah thank you so much for the information.
I understand there is so much in html to look into and a native would be better.
I personally have gone and duplicated HtmlImporter and modified it a lot to support our needs for special import. (It also has a regex engine so we can change tags on the fly before hand.)
Thank you again for your excellent help. I'll look into the other code. Thanks again.

Re: rvHtmlImporter style indent

Posted: Fri May 13, 2022 9:56 pm
by jgkoehn
Greetings Sergey,
I added a bit to rvHtmlViewImport (I think you said though it will no longer be supported, correct?)
If it is easy to add perhaps update this:

Code: Select all

{------------------------------------------------------------------------------}
function TRVHTMLViewImporter.AppendFromFile(const FileName: TRVUnicodeString;
  RV: TCustomRichView): Boolean;
begin
  Result := HTMLViewer <> nil;
  if not Result then
    exit;
  try
    HTMLViewer.LoadFromFile(FileName);
    AppendHtmlViewer(HTMLViewer, RV, ExtractFilePath(FileName));
  except
    Result := False;
  end;
end;
This makes it possible to Append or could change it to fix Insert well sort of. Just a quick idea.

Re: rvHtmlImporter style indent

Posted: Sat Jun 04, 2022 2:21 pm
by Sergey Tkachenko
Ok, I'll add this method in the next update.