HTML Component Library v3.9

HTML Editor Library – WYSIWYG HTML Editor for Delphi. Yes, it is real (and currently the only one) WYSIWYG and 100% native HTML editor written in Delphi.

Basic features
WYSIWYG editing.
Does not use IE or other libraries (100% native Delphi code).
Supports all Delphi versions from Delphi 5 to Delphi 10.2 Tokyo.
VCL (Win32/64) FMX (Windows / OSX / Android / iOS / Linux)
Full support for touch-screen devices – gestures, text selection (Windows Tablets/Screens, iOS, Android, OSX)
Smooth scrolling on Android and iOS.
Unicode support for Delphi 6 – 2007 (requires TNTUnicode).
Scalable (High DPI support).
Live spellchecking and autocorrection (built-in support for Addict).
Live text styles preview (font family,size, color, baclground).
RTF and MS Word DOCX Import on all platforms.
PDF export on Windows, Android, OSX and iOS.
DB-Aware version
Full support for HTML tags and CSS properties.
Full access from Delphi code to DOM and Styles.
Images, lists, blocks, font styles
Tables support
Print and Print Preview
Embedded Find dialog, Text search, Document Index generation.
Copy from/paste to MS Word, browsers and other applications
Embedded Markdown, Pascal and HTML syntax highlighting.
HTML-based editor controls (HtFontCombo, HtFontSizeCombo, HtColotCombo, HtTableAddCombo, HtBorderCombo, HtTableBorderCombo)

Getting started
To start using the editor simply drop a THtmlEditor component on a form and set its HTML:TStrings property or call Editor.HTML.LoadfromFile function in code.

Don’t leave HTML blank, at least code is required.

THtmlEditor is ready to use and most of it’s function are accessible via keyboard (f.e. Ctrl+B for bold).

Using Editor commands
All basic commands are accessible via actions. Place an ActionList on the form and use the New standard action command to add actions from the HtmlEdit group.

The available pre-defined actions are:
THtActionNew – new document
THtFileOpen,- open file.
THtFileSaveAs,- save file as.
THtActionCopy – copy to clipboard
THtActionPaste -paste from clipboard.
THtActionPasteImage – paste image from clipboard.
THtActionUndo – Undo.
THtActionFontBold – set font bold.
THtActionFontItalic – set font italic.
THtActionFontUnderline – set font underline.
THtActionFontStrikeout – set font strikeout.
THtActionSubscript – subscript.
THtActionSuperscript – superscript.
THtActionAlignLeft – set paragraph alignment to left.
THtActionAlignRight – set paragraph alignment to right.
THtActionAlignCenter – set paragraph alignment to center.
THtActionUnorderedList – convert selection to unordered list.
THtActionOrderedList – – convert selection to ordered list.
THtActionIncreaseIndent – increase block or list indent.
THtActionDecreaseIndent – decrease block or list indent.
THtActionAddUrl – convert selection to URL (link).
THtActionSetHeader- convert current block to header (header level are defined by ActionComponent tag).
THtActionMarkdownHighlight – perform Markdown conversion on selection
THtActionPascalHighlight – highlight selection as Pascal code
THtActionHTMLHighlight – highlight selection as HTML code

To control font name and size use THtFontCombo and THtFontSizeCombo components. Just place them on toolbar and set Editor property if there is more than one THtmlEditor component on form.

Basic Editor properties:
Doc: THtDocument
Current document object (see HTML Component Library documentation)
Caret: THtCaret
Current caret positon and state
TextStyle: THtTextStyle
Current text styles (at caret)
OffsetX, OffsetY: integer
Offset (in screen pixels) of document (equal to negative scrollbars positions)
DesignerElement: TElement
Highligted block element containing caret.
Scale: integer
Current document scale in percent. Default =100 (%)
History: THtEditorStateStack;
Undo history

To use Addict library enable $DEFINE ADDICT in \VCL\ before installing the package.

Add TAddictSpell component on the form and set THtmlEditor.AddictSpell property.

To use another spellchecking library you will need to write handlers for the OnSpellCheck and OnWordCorrection events.

You can enable/disable live spellchecking and autocorrection by using the Spellchecking and WordCorrection properties.

Changing document scale
THtmlEditor has a deicated property to make it simple to alter the scale of the document. Simply alter THtmlEditor.Scale and the document and its contents will be fully rescaled.

For examaple, place TTrackBar on form, set its Position to 100 and Min/Max to 50-200.

Enabling Unicode for non-Unicode Delphi
To use Unicode in old Delphi you should have TntUnicode library installed.

Open /VCL/ file, uncomment $WIDESTRINGS define and recompile library package.

Tag Navigator component
Tag navigator component is used to show path to current element (from document root) and highlight block element in document. Simply place it on the form and set its width.

New in 3.7

New layout engine with fast nested tables calculation.
Full text alignment (text-align: justify)
Internal support for RTL lanuages (VCL/FMX)
Lazarus support (Windows, Linux)
Support for text-decoration-color and text-decoration-line
CSS first-of-type pseudo selector
CSS transform: rotate-x
CSS pointer-events property.
HtPanel: added PreservePositionOnHTMLChange property
Native OSX canvas: fast and precise text rendering, animated GIFs
UTF32 (emoji) symbols support in HTML
UTF32 (emoji) symbols support in CSS
Support for colored symbols (emojis) in DirectX canvas.
Added imageindex attribute to HTML popup menu items.
SVG: added stroke-dasharray and stroke-dashoffset properties.
PDF export now supports links and anchors (DirectX and OSX canvases).
Wavy lines on mispelled words.
DevExpress spellchecker support.
Non-breaking space added to empty para by editor is now invisible.
Support for (free) Hunspell spellchecker
VCL: Added Replace dialog.
CSS contenteditable property
Added format for template variables {{STARTDATE(}}
Remote script debugger
Comment prior to function declaration stored as function description.

New in 3.9 HCL/Core

Added support for TVirtualImageList
Improved rendeing of images and text (align to pixel)
HtPanel: added AllowScaling property.
SVG: added support for "use" element.
Added support for external SVG images
Improved RTL support
Automatic detection of RTL blocks
Virtual image source for image lists on other forms, f.e. src="_forms/DataModule1/ImageList2/5"
Improved emoji symbols support for VCL and FMX.
Improved resize hint
Added TCSSStyleSheet.GetAllClasses/GetAllIds
Improved SVG rendering
Added OnElementEnter/Exit event for HtPanel
Added THtDocument.LoadfromStream
Added THtDocument.ElementsFromPoint method returning all elements located at specified point.
Empty attributes with no value now preserves their format
Added support for ForeignObject tag which allows use of HTML blocks inside SVG.
FMX: improved text baseline calculation
Scripter: added support for list of values in case statement: case a of 1,2,3: 


Fast Report component with visual editor and page split support (included in bundle).
Added TDBHTMLEditor.UseOuterHTML property
Added TDBHTMLEditor.NewDocumentTemplate
Editor:Column widths are not preserved when copy/paste part of a table 


Optimized schema loading queries for Oracle.
Added TSQLSelectQuery.ChangeRowLimit class function.
Added TSQLSelectQuery.AddJoin function