TRVHTMLViewImporter: component for importing from HTMLViewer to TRichView.
This component can be used to load HTML files in TRichView and TRichViewEdit.
Version 1.19
----------------------------------------------------------------------------
For Delphi 5 and newer
(supported Delphi versions depend on the THTMLViewer version)
----------------------------------------------------------------------------
TRichView web site: http://www.trichview.com/
THTMLViewer web sites:
- http://www.pbear.com/ (original version)
- http://www.songbeamer.com/delphi/ (ported to Delphi 2009)
- https://github.com/BerndGabriel/HtmlViewer (current version)
----------------------------------------------------------------------------
Copyright (c) 2005 by Andrej Sandorf andrejsandorf@gmx.de
Copyright (c) 2008-... by Sergey Tkachenko svt@trichview.com
----------------------------------------------------------------------------
DOWNLOADING THTMLVIEWER
1) THTMLViewer is currently developed at https://github.com/BerndGabriel/HtmlViewer
This version can be installed in Delphi up to 10 Seattle
This version is recommended.
2) The original version of THTMLViewer is here: www.pbear.com
It can be installed in Delphi 4..2007.
To compile TrvHtmlViewImporter with this version, deactivate GOOGLECODE define
in rvHtmlViewImport.pas.
See "BEFORE INSTALLING" below.
3) THTMLViewer was ported to Delphi 2009: www.songbeamer.com/delphi/
This version can be installed in Delphi 4..XE (XE2 and newer is not tested)
To compile TrvHtmlViewImporter with this version, deactivate GOOGLECODE define
in rvHtmlViewImport.pas.
See "BEFORE INSTALLING" below.
NOTE: GOOGLECODE is defined by default, for compatibility with the recommended
version of THTMLViewer, https://github.com/BerndGabriel/HtmlViewer
It is called GOOGLECODE because originally this version was published
at https://code.google.com/p/thtmlviewer/
----------------------------------------------------------------------------
BEFORE INSTALLING
No changes are required for the recommended version of THTMLViewer
https://github.com/BerndGabriel/HtmlViewer
-------- ONLY FOR pbear.com AND songbeamer.com VERSIONS: -----
In HTMLViewer there must be a small source change to access
variables which are declared as private.
In "Htmlsubs.pas" in class "TBlockLI"
TBlockLI = class(TBlock)
private
protected // <-- insert this, so we can access ListType, etc.
ListType: ListTypeType;
ListNumb: integer;
...
In "HTMLUn2.pas" in class "TChPosObj"
TChPosObj = class (TIDObject)
public < -- change "private" to "public", so we can access ChPos
ChPos: integer;
List: TList;
...
----------------------------------------------------------------------------
INSTALLING
If THTMLViewer (the new, github version) is installed, the TRichView installer installs these components automatically.
If you installed THTMLViewer after TRichView, you can run the TRichView installer again using the shortcut in the Windows Start menu.
----------------------------------------------------------------------------
How to use with RichViewActions
Assign TRVHTMLViewImporter component to TRVAControlPanel.HTMLComponent property.
Additional information can be found in the help file about RichViewActions.
----------------------------------------------------------------------------
How to use:
if OpenDialog1.Execute then begin
HTMLViewer1.LoadFromFile(OpenDialog1.FileName);
RVHTMLViewImporter1.ImportHtmlViewer(HTMLViewer1, RichViewEdit1, ExtractFilePath(OpenDialog1.FileName));
NormalizeRichView(RichViewEdit1.RVData); // from RVNormalize.pas, from RichViewActions
RichViewEdit1.Format;
end;
Alternatively, you can assign HTMLViewer property and call:
if OpenDialog1.Execute then begin
HTMLViewer1.LoadFromFile(OpenDialog1.FileName);
RVHTMLViewImporter1.ImportHtmlViewer(RichViewEdit1, ExtractFilePath(OpenDialog1.FileName));
NormalizeRichView(RichViewEdit1.RVData); // from RVNormalize.pas, from RichViewActions
RichViewEdit1.Format;
end;
HTML can be loaded from the Clipboard as well, using the method LoadFromClipboard.
----------------------------------------------------------------------------
Properties: see the comments in rvHtmlViewImport.pas
----------------------------------------------------------------------------
History:
- version 1.19 - compatibility with TRichView 17.3
- version 1.18.7 - compatibility with TRichView 16.17
- version 1.18.6
- version 1.18.5 - <td height> fix
- version 1.18.4
- version 1.18.3 - 64-bit fix
- version 1.18.2 - support for rvoAssignImageFileNames option and OnAssignImageFileName event
- version 1.18.1 - compatibility with TRichView 16.11
- version 1.18 - integration in RichViewActions without $defines (assign TRVHTMLViewImporter to TRVAControlPanel.HTMLComponent)
- version 1.17 - support for images embedded in HTML; for Delphi XE6 and older, DIMime is required
(http://www.yunqa.de/delphi/products/mime/index , remove the dot from {.$DEFINE RVUSEDMIME} in rvHtmlViewImport.pas)
- version 1.16 - packages are separated to runtime and designtime, designtime code is in a separate unit
- version 1.15.2 (2016-Feb-02) - loading outer spacing for images, loading middle image alignment as rvvaAbsMiddle
- version 1.15.1 (2016-Jan-26) - impr in loading subscripts/superscripts
- version 1.15 (2015-Dec-18) - compatibility with THTMLViewer 11.7; fix: BasePath was ignored when loading a document background
- version 1.14 (2015-Mar-16) - support for "file://" in <img src>
- version 1.13.1 (2014-Oct-15) - fix in CompleteLists; packages for XE7
new CompleteLists property (builds imported lists up to 9 levels)
- version 1.13 (2014-Sep-18) - import of nested <ul> and <ol> as multilevel lists
new CompleteLists property (builds imported lists up to 9 levels)
- version 1.12.2 (2014-Sep-12)
- version 1.12.1 (2014-Aug-07)
- version 1.12 (2014-Jul-15) - compatibility the GC's THTMLViewer revision 475 (2014-Jul-15)
- version 1.11 (2014-Jan-25) - compatibility with TRichView 14.13, reading left- and right-aligned images
- version 1.10 (2013-Aug-27) - BasePath parameter
- version 1.9.6 (2013-Jun-19) - packages for XE4
- version 1.9.5 (2013-Apr-21) - fix
- version 1.9.4 (2013-Apr-18) - compatibility with TRichView 14.4
- version 1.9.3 (2013-Feb-26) - compatibility with TRichView 14.1
- version 1.9.2+ (2012-Oct-24) - packages for XE3
- version 1.9.2 (2012-Aug-11) - using 'Hyperlink' style-template (tested with THTMLViewer revision 316)
- version 1.9.1 (2012-Feb-2) - updated for GC's THTMLViewer revision 240
- version 1.9 (2011-Sep-14) - compatibility with TRichView 13.3; tested with GC's THTMLViewer revision 176
- version 1.8.2 (2011-Mar-31)
- version 1.8.1 (2011-Mar-18) - compatibility with the GC's THTMLViewer 11 revision 168
- version 1.8 (2011-Mar-8) - compatibility with TRichView 13; compatibility with
the Google Code version of THTMLViewer
- version 1.7.2 (2010-Aug-3) - fixes in HTML pasting and others
- version 1.7.1 (2010-May-8) - fix in image size
- version 1.7 (2009-Nov-12) - headings, left and right image alignment
- version 1.6 (2009-Sep-17)
- version 1.5.3 (2009-Apr-26)
- version 1.5.2 (2008-Nov-25)
- version 1.5.1 (2008-Nov-19)
- version 1.5 (2008-Nov-14)
- version 1.4 (2008-Nov-13)
- version 1.3.1 (2008-Sep-27)
- version 1.3 (2008-Sep-20)
- version 1.2 (2008-Sep-06)
- version 1.1 (2008-Jun-24)
- version 1.0 (2008-Jun-16)