4.2.Syntax-highlighting

For the syntax-highlighting of EDI messages, the following two files are responsible:

  • R2EdiViewerSH.css
  • R2EdiViewerSH.cfg

The syntax-highlighting of XML files can not be changed.

4.2.1. R2EdiViewerSH.css

 

With cascading style sheets:

  1. defines the formatting of segments and fields.
  2. defines the mapping Unicode block to Windows TrueType font (.ttf-file).

4.2.1.1 Mapping Unicode block to Windows TrueType font

Both for the correct syntax-highlighting and for PDF creation
(embedding the font in the PDF file ) the appropriate TrueType font must be determined.
At first the Unicode block for each character of the EDI file is determined.
After that the suitable font is determined by the ".font_"-Unicode block line.
You get a message to maintain this file if it is not possible to identify the font.

The "font-family" must be the font name, not the name of the TTF file,
e.g. "Courier New" for the file "cour.ttf".

 

4.2.2. R2EdiViewerSH.cfg

Here is the format of individual formatting of segments / record types or fields:

4.2.2.1. Segments/record types 

An EDI segment / record type is simply assigned to the desired CSS formatting.
Results:
- PAC segment red
- QTY segment bold blue
- UNB segment bold black

4.2.2.2. Fields 

Besides the segments, fields can also be color coded.
To do this, simply add the field number behind the EDI segment and
the CSS formatting have to begin with "field":
- UNH, field 0065 (Message type), bold black with grey background:

If the CSS formatting does not begin with "field" for a field, the entire line is formatted.