示例#1
0
 /**
  * Constructs a new RtfTokeniser. The startGroupLevel is required when parsing
  * RTF fragments, since they are missing the opening group and closing group
  * and thus this has to be set at the beginning.
  *
  * @param rtfParser The RtfParser to send tokens to.
  * @param startGroupLevel The starting group nesting level. 0 for full documents, 1 for fragments.
  */
 public RtfTokeniser(RtfParser rtfParser, int startGroupLevel)
 {
     this.rtfParser  = rtfParser;
     this.groupLevel = startGroupLevel;
 }
示例#2
0
 /**
 * Constructs a new RtfTokeniser. The startGroupLevel is required when parsing
 * RTF fragments, since they are missing the opening group and closing group
 * and thus this has to be set at the beginning.
 *
 * @param rtfParser The RtfParser to send tokens to.
 * @param startGroupLevel The starting group nesting level. 0 for full documents, 1 for fragments.
 */
 public RtfTokeniser(RtfParser rtfParser, int startGroupLevel)
 {
     this.rtfParser = rtfParser;
     this.groupLevel = startGroupLevel;
 }
示例#3
0
 /**
 * Adds a fragment of an RTF document to the current RTF document being generated.
 * Since this fragment doesn't contain font or color tables, all fonts and colors
 * are mapped to the default font and color. If the font and color mappings are
 * known, they can be specified via the mappings parameter.
 *
 * @param documentSource The Reader to read the RTF fragment from.
 * @param mappings The RtfImportMappings that contain font and color mappings to apply to the fragment.
 * @throws IOException On errors reading the RTF fragment.
 * @throws DocumentException On errors adding to this RTF fragment.
 */
 public void ImportRtfFragment(TextReader documentSource, RtfImportMappings mappings)
 {
     if(!this.open) {
         throw new DocumentException("The document must be open to import RTF fragments.");
     }
     RtfParser rtfImport = new RtfParser();
     rtfImport.ImportRtfFragment(documentSource, this.rtfDoc, mappings);
 }