/// <summary> /// (non-Javadoc) /// @see com.lowagie.text.rtf.parser.properties.RtfPropertyListener#beforeChange(java.lang.String) /// </summary> public void BeforePropertyChange(string propertyName) { // do we have any text to do anything with? // if not, then just return without action. if (_buffer.Length == 0) return; if (propertyName.StartsWith(RtfProperty.CHARACTER)) { // this is a character change, // add a new chunck to the current paragraph using current character settings. Chunk chunk = new Chunk(); chunk.Append(_buffer.ToString()); _buffer = new StringBuilder(255); Hashtable charProperties = RtfParser.GetState().Properties.GetProperties(RtfProperty.CHARACTER); string defFont = (string)charProperties[RtfProperty.CHARACTER_FONT]; if (defFont == null) defFont = "0"; RtfDestinationFontTable fontTable = (RtfDestinationFontTable)RtfParser.GetDestination("fonttbl"); Font currFont = fontTable.GetFont(defFont); int fs = Font.NORMAL; if (charProperties.ContainsKey(RtfProperty.CHARACTER_BOLD)) fs |= Font.BOLD; if (charProperties.ContainsKey(RtfProperty.CHARACTER_ITALIC)) fs |= Font.ITALIC; if (charProperties.ContainsKey(RtfProperty.CHARACTER_UNDERLINE)) fs |= Font.UNDERLINE; Font useFont = FontFactory.GetFont(currFont.Familyname, 12, fs, new BaseColor(0, 0, 0)); chunk.Font = useFont; if (_iTextParagraph == null) _iTextParagraph = new Paragraph(); _iTextParagraph.Add(chunk); } else { if (propertyName.StartsWith(RtfProperty.PARAGRAPH)) { // this is a paragraph change. what do we do? } else { if (propertyName.StartsWith(RtfProperty.SECTION)) { } else { if (propertyName.StartsWith(RtfProperty.DOCUMENT)) { } } } } }