RedTitan HTML5 extensions - programming information
© Redtitan Technology 2018
Applies to: RS3 Scripting Engine 2016 version 1.1 LUA version 5.3 January 2016 Revised December 2017 - version 1.2 
 

1. EscapeE HTML5 extensions - programming information
 
 
EscapeE - the Worlds leading document transform system. Your print file becomes your source data. Re-use, extract, re-combine, transform, merge. HTML5 joins a suite of RedTitan applications that gives you back the ownership of your printed and electronic documents. 
 
EscapeE supports a rich subset of HTML5 that may be used to create paginated documents for PDF, Email, browser or variable data applications. Using advanced CSS5 and SVG complex documents may be rendered using a text format that is easily edited , complies to industry standards and can be integrated using scripting functions as a Customer Communication Management System. 
  
1.1 EscapeE HTML5 document framework. 
 
The EscapeE HTML5 Document Object Module is defined as a simple tree structure with a defined syntax in DOCTYPE html format. The array of pages defined by EscapeE HTML5 may be created or edited using EscapeE uberED. 
 
e.g. A two page document.
DOM1.PNG
Each page is a series of text columns, images or SVG objects at defined positions on the logical page 
 
e.g.
DOM2.PNG
Text columns are a concatonated stack of justified paragraphs containing text elements. 
 
e.g. 
DOM3.PNG
The hierarchy is thus
 
DOCUMENT - PAGE - COLUMN - PARAGRAPH - TEXT  
 
EscapeE HTML5 files use UTF8 text encoding. A text body may contain HTML entities, <br/> and <hr/> elements. The unicode space 0xA0 is used to prevent the removal of extra white space.
 
SVG and IMAGE are PAGE level objects. SVG supports circles, lozenge, rotated text captions, ploylines and bezier curves. Images are referenced as a URL or embedded inline. Complex overlays may refer to third party originated PDF - EscapeE may be used to economically update existing PDF with an EscapeE HTML5 document.
 
CSS3 defines class style and column widths refer to bounding boxes (box-sizing: border-box;) i.e. borders and padding are included inside the width. EscapeE HTML5 is supported in all web browsers (April 2016 onwards)
 
1.2 Scripting interface  
 
Variable data merge is supported using the LUA scripting engine with RedTitan extensions. Formal parameters for text markup are introduced using <a> tag hyperlinks within text. The uberED editor supports the "href " URL for normal browser application but permits any number of extra attributes to be added to the <a> element using a "data" attribute name.  (The HTML5 standard supports any attribute with a name starting with the preamble "data-" in any open element) 
 
e.g.

 
dom4.PNG
In this example the attribute "data-eefield" is ignored by a browser but used by a script to locate named markup. 
 
e.g.
-- LUA update markup example 
 
htmlx = THTML.Create("hl.html"); -- parse HTML  
 
ix = htmlx:findAttribute("data-eefield","Stock"); 
 
htmlx:replaceElement(ix,"Treasury 1.75% 2037 (TG37) Gilt"); 
 
ms =TmemoryStream.Create(); 
 
htmlx:savePrologue(ms);
htmlx:saveBody(ms);
htmlx:saveEpilogue(ms);


ms:saveToStream("sipp3.html"); 
 
This example creates an instance of the THTML class (see INIT.LUA). The following methods are defined. 
 
  
findAttribute(name,value:string) 
 
 replaceElement(index:integer;value:string) 
 
 setTitle(value:string) 
 
 setPageSize(width,height:string) 
 
 savePrologue(ms:TmemoryStream) 
 
 saveBody(ms:TmemoryStream); 
 
 saveEpilogue(ms:TmemoryStream); 
 
 Reset 
 
 
Returns element number is the attribute is found, -1 not found  
 
Replace element number with string value 
 
Edit HTML title element 
 
Edit CSS page size. e.g. setPageSise('10in','6in'); 
 
Save up to the <body> element as edited 
 
Save page elements as edited 
 
Save </body></html> 
 
Revert HTML template to unedited  
© Redtitan Technology 2014..2018