How to Import annotations from XML file

How to Import annotations (vector objects) from XML file

 

Use menu items:

Annotations – Import from XML file …

annotations - import from xml file

Available annotations:
LINE, BOX, BITMAP, TEXT, MEMO (Multiline text object),  DateTime Shtamp.

 

<?xml version="1.0" encoding="UTF-8"?>
<Annotations version="1">
    <Line>
    ...
    </Line>
...

</Annotations>

COMMON PROPERTIES

PEN

<Pen>
    <Color>16744448</Color>
    <Style>0</Style>
    <Width>5</Width>
</Pen>

Pen – pen properties.

Color – pen color (TColor).

Style – pen style:

0 – Solid A solid line.
1 – Dash A line made up of a series of dashes.
2 – Dot A line made up of a series of dots.
3 – DashDot A line made up of alternating dashes and dots.
4 – DashDotDot A line made up of a series of dash-dot-dot combinations.
5 – Clear No line is drawn (used to omit the line around shapes that draw an outline using the current pen).
6 – InsideFrame A solid line, but one that may use a dithered color if Width is greater than 1.

Width – pen width.

BRUSH

<Brush>
    <Color>32768</Color>
    <Style>3</Style>
</Brush>

Brush – brush properties.

Color – brush color (TColor).

Style – brush style – specifies the pattern on a brush.

1 – bsSolid,
2 – bsClear,
3 – bsHorizontal,
4 – bsVertical,
5 – bsFDiagonal,
6 – bsBDiagonal,
7 – bsCross,
8 – bsDiagCross

brush style

FONT

Font – font properties.

<Font>
    <FontHeight>-38</FontHeight>
    <FontName>Arial</FontName>
    <FontStyles>0000</FontStyles>
    <FontAngle>0</FontAngle>
</Font>

FontHeight – font height.

FontName – font name.

FontStyles – font style (0000).

  • fsBold  The font is boldfaced.
  • fsItalic  The font is italicized.
  • fsUnderline  The font is underlined.
  • fsStrikeOut  The font is displayed with a horizontal line through it.

FontAngle – rotation angle.

 

ObjLeft, ObjTop, ObjWidth, ObjHeight

<ObjLeft>38</ObjLeft>
<ObjTop>38</ObjTop>
<ObjWidth>724</ObjWidth>
<ObjHeight>529</ObjHeight>

ObjLeft – left offset of object.

ObjTop – top offset of object.

ObjWidth – width of object.

ObjHeight – height of object.

 


LINE

Example:

<Line>
    <Pen>
        <Color>16744448</Color>
        <Style>0</Style>
        <Width>5</Width>
    </Pen>
    <ObjLeft>38</ObjLeft>
    <ObjTop>38</ObjTop>
    <ObjWidth>724</ObjWidth>
    <ObjHeight>529</ObjHeight>

</Line>

Pen – pen properties (see “COMMON PROPERTIES”).

 


BOX

Example:

<Box>
    <Pen>
        <Color>255</Color>
        <Style>0</Style>
        <Width>5</Width>
    </Pen>
    <Brush>
        <Color>32768</Color>
        <Style>3</Style>
    </Brush>
    <ObjLeft>371</ObjLeft>
    <ObjTop>32</ObjTop>
    <ObjWidth>262</ObjWidth>
    <ObjHeight>156</ObjHeight>
</Box>

Pen – pen properties (see “COMMON PROPERTIES”).

Brush – brush properties (see “COMMON PROPERTIES”).

 

<BoxHighlight>1</BoxHighlight>

it makes a filled box as a highlight box (highlight the background with the fill color).

 


TEXT

Example:

<Text>
    <Pen>
        <Color>4194432</Color>
        <Style>5</Style>
        <Width>5</Width>
    </Pen>
    <Brush>
        <Color>16777088</Color>
        <Style>0</Style>
    </Brush>
    <Font>
        <FontHeight>-38</FontHeight>
        <FontName>Arial</FontName>
        <FontStyles>0000</FontStyles>
        <FontAngle>0</FontAngle>
    </Font>
    <TextAlign>2</TextAlign>
    <TextAutoSize>1</TextAutoSize>
    <TextValue>Text 1</TextValue>
    <ObjLeft>29</ObjLeft>
    <ObjTop>235</ObjTop>
    <ObjWidth>105</ObjWidth>
    <ObjHeight>36</ObjHeight>
</Text>

Pen – pen properties (see “COMMON PROPERTIES”).

Brush – brush properties (see “COMMON PROPERTIES”).

Font – font properties (see “COMMON PROPERTIES”).

 

<TextAlign>2</TextAlign>

Text alignment:

0 – Left,

1 – Right,

2 – Center,

3 – Justify

<TextAutoSize>1</TextAutoSize>

Use TextAutoSize to make the Text object adjust its size automatically so the bounding box accommodates the width of the text.

When TextAutoSize is false, the text object has a fixed width.

<TextValue>Text 1</TextValue>

the text shown by TEXT object.


MEMO (multi-line text)

Example:

<Memo>
    <Pen>
        <Color>4194432</Color>
        <Style>0</Style>
        <Width>5</Width>
    </Pen>
    <Brush>
        <Color>8454016</Color>
        <Style>0</Style>
    </Brush>
    <Font>
        <FontHeight>-38</FontHeight>
        <FontName>Arial</FontName>
        <FontStyles>0000</FontStyles>
        <FontAngle>0</FontAngle>
    </Font>
    <TextAlign>0</TextAlign>
    <TextAutoSize>1</TextAutoSize>
    <TextValue>Text 2-1
Text 2-2
Text 2-3</TextValue>
    <ObjLeft>120</ObjLeft>
    <ObjTop>404</ObjTop>
    <ObjWidth>199</ObjWidth>
    <ObjHeight>137</ObjHeight>
</Memo>

Pen – pen properties (see “COMMON PROPERTIES”).

Brush – brush properties (see “COMMON PROPERTIES”).

Font – font properties (see “COMMON PROPERTIES”).

 

<TextAlign>2</TextAlign>

Text alignment:

0 – Left,

1 – Right,

2 – Center,

3 – Justify

<TextAutoSize>1</TextAutoSize>

Use TextAutoSize to make the Text object adjust its size automatically so the bounding box accommodates the width of the text.

When TextAutoSize is false, the text object has a fixed width.

<TextValue>Text 2-1
Text 2-2
Text 2-3</TextValue>

the text shown by MEMO object.

MemoBorderStyle – the style of the memo border (see Pen Style).

MemoBorderColor – specifies the color of the memo border (see Pen Color).

MemoMarginBottom
Specifies the bottom margin in percentage of vertical height.

MemoMarginRight
Specifies the right margin in percentage of horizontal width.

MemoMarginTop
Specifies the top margin in percentage of vertical height.

MemoMarginLeft
Specifies the left margin in percentage of horizontal width.


BITMAP (IMAGE)

Example:

<Bitmap>
    <ObjSoftShadow>1</ObjSoftShadow>
    <BitmapFile>C:\TEMP\TestFiles2.jpg</BitmapFile>
    <ObjLeft>135</ObjLeft>
    <ObjTop>282</ObjTop>
    <ObjWidth>231</ObjWidth>
    <ObjHeight>116</ObjHeight>
</Bitmap

<ObjSoftShadow>1</ObjSoftShadow>

ObjSoftShadow enables the object shadow properties.

<BitmapBorder>1</BitmapBorder>

If “1” a border around the bitmap object will be painted.

<BitmapFile>C:\TEMP\TestFiles2.jpg</BitmapFile>

BitmapFile is the image (bitmap) that object shows.

 


Download “example-1.xml”

 


Available program with these features:

Leave a Reply