### Tools for Viewing, Printing, Markup and Conversion

Home  Products   How to Buy   Support   Company
Software Companions XML Markup Format Description
ViewCompanion 8

The Software Companions XML markup format can be easily created by a third-party application or by using a text editor. By using this format you can create your own markup files from scratch. Most of the different markup element types available in ViewCompanion, can be created from XML. A xml formatted markup file can be used in combination with the command line option /lxml.
The default extension for a Software Companions XML Markup File is .scmx, but .xml can also be used.

File Format Specification

```<?xml version="1.0" encoding="UTF-8"?>
<SCMarkupFormat>
```

Only UTF-8 encoding is currently supported.
The header and elements section must then follow. A layers section can optionally be included.
A sample xml markup file is shown below:

```<?xml version="1.0" encoding="UTF-8"?>
<SCMarkupFormat>
<Unit>mm</Unit>
<Layers>
<layer name="Markup Layer 1" color="#0000FF" enabled='1'/>
<layer name="Markup Layer Two" color="#00ff00" enabled='1'/>
</Layers>
<Elements>
<Element>
<type>Text</type>
<layer>0</layer>
<page>0</page>
<insertx>10</insertx>
<inserty>30</inserty>
<user>Peter</user>
<color>#FF0000</color>
<text>This is a text</text>
<rotation>45</rotation>
<font height='10' facename='Times New Roman'/>
</Element>
</Elements>
</SCMarkupFormat>
```

This xml markup file defines a single text element. The insert position is 10mm from left and 30 mm from bottom of the drawing. The markup coordinate system origin is always the lower left corner of the drawing. The coordinates can be given in millimeters, inches or native (1016 DPI) values. All color values are coded as red, green and blue intensities in hexadecimal notation (HTML standard - #RRGGBB).
The Layers section defines two layers.

This section contains settings that are common for all markup elements.
The supported entries in this section are:

Unit
Accepted values:
 Value Description mm Coordinates and sizes are given in millimeters. inch Coordinates and sizes are given in inches. mil Coordinates and sizes are given in 1/1000 inch. native Coordinates and sizes are given in native plotter coordinates (1016 DPI).

Layers Section

This section contains layer definitions. Each layer definition can have three different attributes.
The first defined layer will have index 0, the next one 1, etc. The layer index is used when elements are defined.

The description of each attribute is given below:
 Attribute Name Description Name Name to use for the layer. Color Default color to use for elements placed on this layer. Enabled Enter a value different from 0 to make the layer visible.

Sample entry:
<Layer name="Markup Layer 1" color="#0000FF" enabled='1'/>
This entry will create a layer that are named "Markup Layer 1", with default color blue and it will be visible/enabled.

Elements Section

This section contains one or more Element entries. See description of Element section below.

Element Section

This section defines a new markup element. Some of the entry keywords are common for all element types, and some are specific.
The table below lists the keywords that are common for all elements:

 Keyword Description type Markup element type. The following element types are supported: Arrow Ellipse Erase Polygonal Area Erase Rectangular Area Eraser Line Picture Polygon Polyline Rectangle Revision Cloud Rubber Stamp Symbol Text handle An unique element numerical id. hyperlink Link to a document or an URL. layer Layer index to use for the markup element. page Page index where the markup element will be placed. Page indexes are zero based. transparent If defined, the markup element will be transparent. user Name of the user that have created the element (optional).

Arrow Markup Element

The arrow element requires the following keywords, in addition to the common keywords:

 Keyword Description points This section contains one point entry for each point in the arrow polyline. Each point is defined with an x and y attribute. See the xml definition below for an example on how to describe point entries. color Define draw color to use for the element. arrowhead Define type of arrow header to use. Supported arrow types: 0: open, 1: closed, 2: filled. arrowsize Define size of arrow header. linewidth Define width of the arrow lines. The width is defined using the active unit. This entry is optional.
 Sample arrow element xml definition: ``` Arrow 0 0 #FF0000 2 5 0.3 ``` The xml data to the left will create the following arrow:

Ellipse Markup Element

The ellipse element requires the following keywords, in addition to the common keywords:

 Keyword Description boundary Define boundary for the created ellipse. The boundary is defined using four attributes.These attributes are named: x1, y1, x2 and y2. Sample boundary entry: fillcolor Define fill color to use for the element. color Define outline color to use for the element. linewidth Define width of the outline. The width is defined using the active unit. This entry is optional. linestyle Define line style to use for the outline. This entry is optional. fillstyle Define fill style to use for the element. This entry is optional.
 Sample ellipse element xml definition: ``` Ellipse 0 0 Paul #FF0000 #FFCCFF 1 1.0 ``` The xml data to the left will create the following ellipse:

Erase Polygonal Area

Define an area to hide (erase) using a polygon. This feature is also known as wipeout.
The erase polygonal area element requires the following keywords, in addition to the common keywords:

 Keyword Description points This section contains one point entry for each point in the polygon. Each point is defined with an x and y attribute. See the xml definition below for an example on how to describe point entries.
 Sample erase polygonal area element xml definition: ``` Erase Polygonal Area 0 0 Bill ``` The xml data to the left will erase the polygonal area as shown below when used for sample file compare_revA.plt: Before xml markup is loaded. After xml markup is loaded.

Erase Rectangular Area

Define an area to hide (erase) using a rectangle. This feature is also known as wipeout.
The erase rectangular area element requires the following keywords, in addition to the common keywords:

 Keyword Description boundary Define boundary for the created rectangle. The boundary is defined using four attributes.These attributes are named: x1, y1, x2 and y2. Sample boundary entry:
 Sample erase rectangular area element xml definition: ``` Erase Rectangular Area 0 0 ``` The xml data to the left will erase the rectangular area as shown below when used for sample file compare_revA.plt: Before xml markup is loaded. After xml markup is loaded.

Eraser

Define a polyline that will erase/hide drawing contents. This is known as the freehand eraser in ViewCompanion.
The polyline defined will be drawn with the current background color and with the width defined by the linewidth setting.
The eraser element requires the following keywords, in addition to the common keywords:

 Keyword Description points This section contains one point entry for each point in the polyline. Each point is defined with an x and y attribute. See the xml definition below for an example on how to describe point entries.
 Sample eraser element xml definition: ``` Eraser 0 0 5.0 ```

Line Markup Element

The line element requires the following keywords, in addition to the common keywords:

 Keyword Description boundary Define boundary for the created line. The boundary is defined using four attributes.These attributes are named: x1, y1, x2 and y2. Sample boundary entry: . The line will be drawn between x1,y1 and x2,y2. color Define line color to use for the element. linewidth Define the width of the line. The width is defined using the active unit. This entry is optional. linestyle Define line style to use for the line. This entry is optional.
 Sample line element xml definition: ``` Line 0 0 Bill #00FF00 1.0 0 ``` The xml data to the left will create the following line:

Picture Markup Element

The picture element requires the following keywords, in addition to the common keywords:

 Keyword Description boundary Define boundary for the created line. The boundary is defined using four attributes.These attributes are named: x1, y1, x2 and y2. Sample boundary entry: .The picture will be scaled to fit the rectangle defined by x1,y1 and x2,y2. filename Full path to the picture file that will be added as markup.Please note that either double back slash (\\), or a single slash (/) must be used.
 Sample picture element xml definition: ``` Picture 0 0 D:\\temp\\logo.jpg Bill ``` The xml data to the left will add the following picture:

Polygon Markup Element

The polygon element requires the following keywords, in addition to the common keywords:

 Keyword Description points This section contains one point entry for each point in the polygon. Each point is defined with an x and y attribute. See the polygon element definition below for an example on how to describe point entries. color Define line color to use for the element. fillcolor Define fill color to use for the element. color Define outline color to use for the element. linewidth Define width of the outline. The width is defined using the active unit. This entry is optional. linestyle Define line style to use for the outline. This entry is optional. fillstyle Define fill style to use for the element. This entry is optional.
 Sample polygon element xml definition: ``` Polygon 0 0 Bill #FF0000 #CCFFCC 0 1 ``` The xml data to the left will create the following 4-point polygon:

Polyline Markup Element

The polyline element requires the following keywords, in addition to the common keywords:

 Keyword Description points This section contains one point entry for each point in the polyline. Each point is defined with an x and y attribute. See the polyline element definition below for an example on how to describe point entries. color Define line color to use for the element. fillcolor Define fill color to use for the element. color Define outline color to use for the element. linewidth Define width of the polyline. The width is defined using the active unit. This entry is optional. linestyle Define line style to use for the outline. This entry is optional. fillstyle Define fill style to use for the element. This entry is optional.
 Sample polyline element xml definition:``` Polyline 0 0 Bill #FF0000 0.5 ``` The xml data to the left will create the following 4-point polyline:

Rectangle Markup Element

The rectangle element requires the following keywords, in addition to the common keywords:

 Keyword Description boundary Define boundary for the created rectangle. The boundary is defined using four attributes.These attributes are named: x1, y1, x2 and y2. Sample boundary entry: fillcolor Define fill color to use for the element. color Define outline color to use for the element. linewidth Define width of the outline. The width is defined using the active unit. This entry is optional. linestyle Define line style to use for the outline. This entry is optional. fillstyle Define fill style to use for the element. This entry is optional.
 Sample rectangle element xml definition: ``` Rectangle 0 0 Ben #0000FF #00CCFF 1 0 ``` The xml data to the left will create the following rectangle:

Revision Cloud Markup Element

The revision cloud element requires the following keywords, in addition to the common keywords:

 Keyword Description boundary Define boundary for the created revision cloud. The boundary is defined using four attributes.These attributes are named: x1, y1, x2 and y2. Sample boundary entry: fillcolor Define fill color to use for the element. color Define outline color to use for the element. linewidth Define width of the outline. The width is defined using the active unit. This entry is optional. linestyle Define line style to use for the outline. This entry is optional. fillstyle Define fill style to use for the element. This entry is optional.
 Sample revision cloud element definition: ``` Revision Cloud 0 0 Mary #FF00FF 0 3 ``` The xml data to the left will create the following revision cloud:

Rubber Stamp Markup Element

The rubber stamp element requires the following keywords, in addition to the common keywords:

 Keyword Description boundary Define boundary for the created rubber stamp. The boundary is defined using four attributes.These attributes are named: x1, y1, x2 and y2. Sample boundary entry: backcolor Define stamp background color. textcolor Define color to use for the stamp text. text Stamp text. font Define font to use for the stamp text.The font is defined using several different attributes, each of them correspond to the Windows LOGFONT defintition.The following font attributes are supported: height - Same as LOGFONT lfHeight. Please note that ViewCompanion will recalculate this value. orientation - Same as LOGFONT lfOrientation. weight - Same as LOGFONT lfWeight. italic - Same as LOGFONT lfItalic. underline - Same as LOGFONT lfUnderline. strikeout - Same as LOGFONT lfStrikeout. charset - Same as LOGFONT lfCharset. outprecision - Same as LOGFONT lfOutPrecision. clipprecision - Same as LOGFONT lfClipPrecision. quality - Same as LOGFONT lfQuality. pitch - Same as LOGFONT lfPitchAndFamily. facename - Same as LOGFONT lfFaceName. Sample font definition: linewidth Define width of the outline. The width is defined using the active unit. This entry is optional.
 Sample rubber stamp element definition: ``` Rubber Stamp 0 0 Bob Draft #FF0000 #FFCCCC ``` The xml data to the left will create the following rubber stamp:

Symbol Markup Element

The symbol element requires the following keywords, in addition to the common keywords:

 Keyword Description boundary Define boundary for the created symbol. The boundary is defined using four attributes.These attributes are named: x1, y1, x2 and y2. Sample boundary entry: symbollibrary The name of the symbol library to use. symbolname The name of the symbol to use.
 Sample symbol element definition (the Sample library is included in the ViewCompanion installation): ``` Symbol 0 0 Kim Sample Copyright ``` The xml data to the left will add the following symbol to the file:

Text Markup Element

The text element requires the following keywords, in addition to the common keywords:

 Keyword Description insertx Text x insert coordinate. Coordinate is defined using the active unit. inserty Text y insert coordinate. Coordinate is defined using the active unit. rotation Text rotation in degrees. textcolor Define color to use for the text. text Text. font Define font to use for the text.The font is defined using several different attributes, each of them correspond to the Windows LOGFONT defintition.The following font attributes are supported: height - Same as LOGFONT lfHeight. width - Samer as LOGFONT lfWidth. orientation - Same as LOGFONT lfOrientation. weight - Same as LOGFONT lfWeight. italic - Same as LOGFONT lfItalic. underline - Same as LOGFONT lfUnderline. strikeout - Same as LOGFONT lfStrikeout. charset - Same as LOGFONT lfCharset. outprecision - Same as LOGFONT lfOutPrecision. clipprecision - Same as LOGFONT lfClipPrecision. quality - Same as LOGFONT lfQuality. pitch - Same as LOGFONT lfPitchAndFamily. facename - Same as LOGFONT lfFaceName. Sample font defintion:
 Sample text element defintion: ``` Text 0 0 Bob 10 30 #FF0000 This is a text 45 ``` The xml data to the left will create the following text element:

Line and Fill Style Values

Linestyle

The linestyle can be defined using one of the following values:
0 Solid line.
1 Dashed line.
2 Dotted line.
3 Dash-dot line.
4 Dash-dot-dot line.

Fillstyle

The fillstyle can have one the following values:
0 Outlined (no fill).
1 Solid fill.
2 Horizontal hatch.
3 Vertical hatch.
4 Crosshatched.
5 Diagonal hatch.
6 Diagonal cross hatching.