SetRtfDocument() public method

public SetRtfDocument ( RtfDocument doc ) : void
doc iTextSharp.text.rtf.document.RtfDocument
return void
示例#1
0
 /**
  * Imports a font. The font name is looked up in the RtfDocumentHeader and
  * then the mapping from original font number to actual font number is added.
  *
  * @param fontNr The original font number.
  * @param fontName The font name to look up.
  */
 public void ImportFont(String fontNr, String fontName)
 {
     iTextSharp.text.rtf.style.RtfFont rtfFont = new iTextSharp.text.rtf.style.RtfFont(fontName);
     rtfFont.SetRtfDocument(this.rtfDoc);
     this.importFontMapping[fontNr] = this.rtfDoc.GetDocumentHeader().GetFontNumber(rtfFont).ToString();
 }
示例#2
0
        /**
        * Imports a font. The font name is looked up in the RtfDocumentHeader and
        * then the mapping from original font number to actual font number is added.
        *
        * @param fontNr The original font number.
        * @param fontName The font name to look up.
        * @param charset The characterset to use for the font.
        */
        public bool ImportFont(String fontNr, String fontName, String fontFamily, int charset)
        {
            RtfFont rtfFont = new RtfFont(fontName);

            if (charset>= 0)
                rtfFont.SetCharset(charset);
            if (fontFamily != null && fontFamily.Length > 0)
                rtfFont.SetFamily(fontFamily);
            rtfFont.SetRtfDocument(this.rtfDoc);
            this.importFontMapping[fontNr] = this.rtfDoc.GetDocumentHeader().GetFontNumber(rtfFont).ToString();
            return true;
        }
示例#3
0
 /// <summary>
 /// Sets the RtfDocument this RtfElement belongs to
 /// </summary>
 /// <param name="doc">The RtfDocument to use</param>
 public void SetRtfDocument(RtfDocument doc)
 {
     Document = doc;
     _font.SetRtfDocument(Document);
 }
示例#4
0
 /**
 * Imports a font. The font name is looked up in the RtfDocumentHeader and
 * then the mapping from original font number to actual font number is added.
 *
 * @param fontNr The original font number.
 * @param fontName The font name to look up.
 */
 public bool ImportFont(String fontNr, String fontName)
 {
     RtfFont rtfFont = new RtfFont(fontName);
     if (rtfFont != null){
         rtfFont.SetRtfDocument(this.rtfDoc);
         this.importFontMapping[fontNr] = this.rtfDoc.GetDocumentHeader().GetFontNumber(rtfFont).ToString();
         return true;
     } else {
         return false;
     }
 }
示例#5
0
 /**
 * Imports a font. The font name is looked up in the RtfDocumentHeader and
 * then the mapping from original font number to actual font number is added.
 *
 * @param fontNr The original font number.
 * @param fontName The font name to look up.
 */
 public void ImportFont(String fontNr, String fontName)
 {
     iTextSharp.text.rtf.style.RtfFont rtfFont = new iTextSharp.text.rtf.style.RtfFont(fontName);
     rtfFont.SetRtfDocument(this.rtfDoc);
     this.importFontMapping[fontNr] = this.rtfDoc.GetDocumentHeader().GetFontNumber(rtfFont).ToString();
 }