Example #1
0
 /**
  * Constructs a new RtfColorTableParser.
  *
  * @param importHeader The RtfImportHeader to add the color mappings to.
  */
 public RtfColorTableParser(RtfImportHeader importHeader)
 {
     this.importHeader = importHeader;
     this.colorNr      = 0;
     this.red          = -1;
     this.green        = -1;
     this.blue         = -1;
 }
Example #2
0
 /**
  * Imports a complete RTF document.
  *
  * @param reader The Reader to read the RTF document from.
  * @param rtfDoc The RtfDocument to add the imported document to.
  * @throws IOException On I/O errors.
  * @throws DocumentException On document writing errors.
  */
 public void ImportRtfDocument(TextReader reader, RtfDocument rtfDoc)
 {
     this.rtfDoc           = rtfDoc;
     this.state            = PARSER_IN_HEADER;
     this.importHeader     = new RtfImportHeader(this.rtfDoc);
     this.fontTableParser  = new RtfFontTableParser(this.importHeader);
     this.colorTableParser = new RtfColorTableParser(this.importHeader);
     this.tokeniser        = new RtfTokeniser(this, 0);
     this.tokeniser.Tokenise(reader);
 }
Example #3
0
 /**
  * Imports an RTF fragment.
  *
  * @param reader The Reader to read the RTF fragment from.
  * @param rtfDoc The RTF document to add the RTF fragment to.
  * @param importMappings The RtfImportMappings defining font and color mappings for the fragment.
  * @throws IOException On I/O errors.
  * @throws DocumentException On document writing errors.
  */
 public void ImportRtfFragment(TextReader reader, RtfDocument rtfDoc, RtfImportMappings importMappings)
 {
     this.rtfDoc           = rtfDoc;
     this.state            = PARSER_IN_DOCUMENT;
     this.importHeader     = new RtfImportHeader(this.rtfDoc);
     this.fontTableParser  = new RtfFontTableParser(this.importHeader);
     this.colorTableParser = new RtfColorTableParser(this.importHeader);
     HandleImportMappings(importMappings);
     this.tokeniser = new RtfTokeniser(this, 1);
     this.tokeniser.Tokenise(reader);
 }
Example #4
0
 /**
  * Constructs a new RtfFontTableParser.
  *
  * @param importHeader The RtfImportHeader to add font mappings to.
  */
 public RtfFontTableParser(RtfImportHeader importHeader)
 {
     this.importHeader = importHeader;
     this.fontNr       = "";
     this.fontName     = "";
 }
Example #5
0
 /**
 * Imports an RTF fragment.
 *
 * @param reader The Reader to read the RTF fragment from.
 * @param rtfDoc The RTF document to add the RTF fragment to.
 * @param importMappings The RtfImportMappings defining font and color mappings for the fragment.
 * @throws IOException On I/O errors.
 * @throws DocumentException On document writing errors.
 */
 public void ImportRtfFragment(TextReader reader, RtfDocument rtfDoc, RtfImportMappings importMappings)
 {
     this.rtfDoc = rtfDoc;
     this.state = PARSER_IN_DOCUMENT;
     this.importHeader = new RtfImportHeader(this.rtfDoc);
     this.fontTableParser = new RtfFontTableParser(this.importHeader);
     this.colorTableParser = new RtfColorTableParser(this.importHeader);
     HandleImportMappings(importMappings);
     this.tokeniser = new RtfTokeniser(this, 1);
     this.tokeniser.Tokenise(reader);
 }
Example #6
0
 /**
 * Imports a complete RTF document.
 *
 * @param reader The Reader to read the RTF document from.
 * @param rtfDoc The RtfDocument to add the imported document to.
 * @throws IOException On I/O errors.
 * @throws DocumentException On document writing errors.
 */
 public void ImportRtfDocument(TextReader reader, RtfDocument rtfDoc)
 {
     this.rtfDoc = rtfDoc;
     this.state = PARSER_IN_HEADER;
     this.importHeader = new RtfImportHeader(this.rtfDoc);
     this.fontTableParser = new RtfFontTableParser(this.importHeader);
     this.colorTableParser = new RtfColorTableParser(this.importHeader);
     this.tokeniser = new RtfTokeniser(this, 0);
     this.tokeniser.Tokenise(reader);
 }
 /**
 * Constructs a new RtfColorTableParser.
 *
 * @param importHeader The RtfImportHeader to add the color mappings to.
 */
 public RtfColorTableParser(RtfImportHeader importHeader)
 {
     this.importHeader = importHeader;
     this.colorNr = 0;
     this.red = -1;
     this.green = -1;
     this.blue = -1;
 }
 /**
 * Constructs a new RtfFontTableParser.
 *
 * @param importHeader The RtfImportHeader to add font mappings to.
 */
 public RtfFontTableParser(RtfImportHeader importHeader)
 {
     this.importHeader = importHeader;
     this.fontNr = "";
     this.fontName = "";
 }