diff --git a/PROMS/fmtxml/RtfToSvg.cs b/PROMS/fmtxml/RtfToSvg.cs
new file mode 100644
index 00000000..0f1830a0
--- /dev/null
+++ b/PROMS/fmtxml/RtfToSvg.cs
@@ -0,0 +1,336 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.IO;
+using System.Text.RegularExpressions;
+using System.Drawing;
+using System.Xml;
+
+namespace fmtxml
+{
+ public class RtfToSvg
+ {
+ public RtfToSvg(string rtfFileName)
+ {
+ RtfFileName = rtfFileName;
+ }
+ public RtfToSvg(FileInfo rtfFile)
+ {
+ RtfFile = rtfFile;
+ }
+ private bool? _IsGenMac;
+ public bool IsGenMac
+ {
+ get
+ {
+ if (_IsGenMac == null)
+ Convert();
+ return (bool)_IsGenMac;
+ }
+ set { _IsGenMac = value; }
+ }
+ private string _RtfFileName;
+ public string RtfFileName
+ {
+ get { return _RtfFileName; }
+ set
+ {
+ _RtfFileName = value;
+ _RtfFile = new FileInfo(_RtfFileName);
+ }
+ }
+ private FileInfo _RtfFile;
+ public FileInfo RtfFile
+ {
+ get { return _RtfFile; }
+ set
+ {
+ _RtfFile = value;
+ _RtfFileName = _RtfFile.FullName;
+ }
+ }
+ private string _Svg;
+ public string Svg
+ {
+ get
+ {
+ if (_Svg == null)
+ Convert();
+ return _Svg;
+ }
+ }
+ private string Convert()
+ {
+ string buff = LoadFile(RtfFile);// Load Text
+ _Svg = CreateSvg(RtfFile, buff);// Convert to SVG
+ return _Svg;
+ }
+ ///
+ /// Load the file into a string by bytes
+ ///
+ ///
+ ///
+ private static string LoadFile(FileInfo file)
+ {
+ byte[] bytes = new byte[file.Length];
+ using (FileStream fs = file.OpenRead())
+ {
+ fs.Read(bytes, 0, (int)file.Length);
+ fs.Close();
+ }
+ StringBuilder sb = new StringBuilder();
+ foreach (byte byt in bytes)
+ sb.Append((char)byt);
+ return sb.ToString();
+ }
+ private const string _TripleBang = "\xAD\xAD\xAD\xA8\xA8";
+ Regex regLines = new Regex(@"([^\r\n]*)?\r?\n", RegexOptions.Singleline);
+ private string CreateSvg(FileInfo file, string buff)
+ {
+ IsGenMac = (buff.Substring(0, 5) == _TripleBang);
+ if(!IsGenMac)
+ return null;
+ StringBuilder sb = new StringBuilder();
+ MatchCollection lines = regLines.Matches(buff);
+ bool svg = false;
+ bool group = false;
+ bool hasC0 = false;
+ foreach (Match line in lines)
+ {
+ string text = line.Groups[1].Value;
+ if (text == _TripleBang)
+ if (!svg)
+ svg = AddSvgPrefix(file, sb, svg);
+ else
+ AddSvgSuffix(sb, hasC0);
+ else if (text.StartsWith("\xAD\xAD"))
+ hasC0 |= AddGroupStart(sb, ref group, text).ToLower() == "c0";
+ else if (text == "END")
+ group = AndGroupEnd(sb, group);
+ else if (text != "")
+ ProcessCommand(sb, text, file);
+ }
+ return sb.ToString();
+ }
+ private static void AddSvgSuffix(StringBuilder sb, bool hasC0)
+ {
+ if (!hasC0)
+ {
+ AddC0(sb);
+ }
+ sb.Append(string.Format("\r\n"));
+ }
+ private static bool AndGroupEnd(StringBuilder sb, bool group)
+ {
+ if (group) sb.Append(" \r\n");
+ group = false;
+ return group;
+ }
+ private static string AddGroupStart(StringBuilder sb, ref bool group, string text)
+ {
+ AndGroupEnd(sb, group);
+ group = true;
+ string grpID = text.Substring(2).ToUpper();
+ sb.Append(string.Format(" \r\n", grpID));
+ return grpID;
+ }
+ private static void AddC0(StringBuilder sb)
+ {
+ sb.Append(" \r\n");
+ sb.Append(" \r\n");
+ sb.Append(" \r\n");
+ }
+ private static bool AddSvgPrefix(FileInfo file, StringBuilder sb, bool svg)
+ {
+ sb.Append("\r\n");
+ sb.Append("