Exemple #1
0
		public Test() {
			MemoryStream	stream;
			RTF		rtf;
			byte[]		buffer;

			text = new TextMap();
			TextMap.SetupStandardTable(text.Table);

			buffer = new byte[rtf_string.Length];
			for (int i = 0; i < buffer.Length; i++) {
				buffer[i] = (byte)rtf_string[i];
			}
			stream = new MemoryStream(buffer);
			rtf = new RTF(stream);

			skip_width = 0;
			skip_count = 0;

			rtf.ClassCallback[TokenClass.Text] = new ClassDelegate(HandleText);
			rtf.ClassCallback[TokenClass.Control] = new ClassDelegate(HandleControl);

			rtf.Read();

			stream.Close();
		}
Exemple #2
0
		public Test(string[] args) {
			if (args.Length == 0)
				throw new Exception ("Program needs path to rtf file as argument");

			FileStream	stream;
			RTF		rtf;

			text = new TextMap();
			TextMap.SetupStandardTable(text.Table);

			stream = new FileStream (@"../test.rtf", FileMode.Open);
			rtf = new RTF(stream);

			skip_width = 0;
			skip_count = 0;

			rtf.ClassCallback[TokenClass.Text] = new ClassDelegate(HandleText);
			rtf.ClassCallback[TokenClass.Control] = new ClassDelegate(HandleControl);

			rtf.Read();

			stream.Close();
		}