當前位置: 首頁>>代碼示例>>C#>>正文


C# document.RtfDocument類代碼示例

本文整理匯總了C#中iTextSharp.text.rtf.document.RtfDocument的典型用法代碼示例。如果您正苦於以下問題:C# RtfDocument類的具體用法?C# RtfDocument怎麽用?C# RtfDocument使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


RtfDocument類屬於iTextSharp.text.rtf.document命名空間,在下文中一共展示了RtfDocument類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: RtfParagraph

 /**
 * Constructs a RtfParagraph belonging to a RtfDocument based on a Paragraph.
 * 
 * @param doc The RtfDocument this RtfParagraph belongs to
 * @param paragraph The Paragraph that this RtfParagraph is based on
 */
 public RtfParagraph(RtfDocument doc, Paragraph paragraph) : base(doc) {
     ST.RtfFont baseFont = null;
     if (paragraph.Font is ST.RtfParagraphStyle) {
         this.paragraphStyle = this.document.GetDocumentHeader().GetRtfParagraphStyle(((ST.RtfParagraphStyle) paragraph.Font).GetStyleName());
         baseFont = this.paragraphStyle;
     } else {
         baseFont = new ST.RtfFont(this.document, paragraph.Font);
         this.paragraphStyle = new ST.RtfParagraphStyle(this.document, this.document.GetDocumentHeader().GetRtfParagraphStyle("Normal"));
         this.paragraphStyle.SetAlignment(paragraph.Alignment);
         this.paragraphStyle.SetFirstLineIndent((int) (paragraph.FirstLineIndent * RtfElement.TWIPS_FACTOR));
         this.paragraphStyle.SetIndentLeft((int) (paragraph.IndentationLeft * RtfElement.TWIPS_FACTOR));
         this.paragraphStyle.SetIndentRight((int) (paragraph.IndentationRight * RtfElement.TWIPS_FACTOR));
         this.paragraphStyle.SetSpacingBefore((int) (paragraph.SpacingBefore * RtfElement.TWIPS_FACTOR));
         this.paragraphStyle.SetSpacingAfter((int) (paragraph.SpacingAfter * RtfElement.TWIPS_FACTOR));
         if (paragraph.HasLeading()) {
             this.paragraphStyle.SetLineLeading((int) (paragraph.Leading * RtfElement.TWIPS_FACTOR));
         }
         this.paragraphStyle.SetKeepTogether(paragraph.KeepTogether);
     }
     
     for (int i = 0; i < paragraph.Count; i++) {
         IElement chunk = (IElement) paragraph[i];
         if (chunk is Chunk) {
             ((Chunk) chunk).Font = baseFont.Difference(((Chunk) chunk).Font);
         } else if (chunk is RtfImage) {
             ((RtfImage) chunks[i]).SetAlignment(this.paragraphStyle.GetAlignment());
         }
         try {
             IRtfBasicElement[] rtfElements = doc.GetMapper().MapElement(chunk);
             for(int j = 0; j < rtfElements.Length; j++) {
                 chunks.Add(rtfElements[j]);
             }
         } catch (DocumentException) {
         }
     }
 }
開發者ID:nicecai,項目名稱:iTextSharp-4.1.6,代碼行數:42,代碼來源:RtfParagraph.cs

示例2: SetRtfDocument

 /**
 * Sets the RtfDocument this RtfElement belongs to
 *
 * @param doc The RtfDocument to use
 */
 public void SetRtfDocument(RtfDocument doc)
 {
     this.document = doc;
     if (this.document != null) {
         for (int i = 0; i < this.content.Length; i++) {
             try {
                 if (this.content[i] is Element) {
                     this.content[i] = this.document.GetMapper().MapElement((IElement) this.content[i])[0];
                     ((IRtfBasicElement) this.content[i]).SetInHeader(true);
                 } else if (this.content[i] is IRtfBasicElement){
                     ((IRtfBasicElement) this.content[i]).SetRtfDocument(this.document);
                     ((IRtfBasicElement) this.content[i]).SetInHeader(true);
                 }
             } catch (DocumentException) {
             }
         }
     }
 }
開發者ID:bmictech,項目名稱:iTextSharp,代碼行數:23,代碼來源:RtfHeaderFooter.cs

示例3: RtfWriter2

 /**
 * Constructs a new RtfWriter that listens to the specified Document and
 * writes its output to the Stream.
 * 
 * @param doc The Document that this RtfWriter listens to
 * @param os The Stream to write to
 */
 protected RtfWriter2(Document doc, Stream os) : base(doc, os) {
     doc.AddDocListener(this);
     rtfDoc = new RtfDocument();
 }
開發者ID:nicecai,項目名稱:iTextSharp-4.1.6,代碼行數:11,代碼來源:RtfWriter2.cs

示例4: RtfPageSetting

 /**
 * Constructs a new RtfPageSetting object belonging to a RtfDocument.
 * 
 * @param doc The RtfDocument this RtfPageSetting belongs to 
 */
 public RtfPageSetting(RtfDocument doc) : base(doc) {
 }
開發者ID:nicecai,項目名稱:iTextSharp-4.1.6,代碼行數:7,代碼來源:RtfPageSetting.cs

示例5: RtfFontList

 /**
 * Creates a RtfFontList
 *
 * @param doc The RtfDocument this RtfFontList belongs to
 */
 public RtfFontList(RtfDocument doc)
     : base(doc)
 {
     fontList.Add(new RtfFont(document, 0));
 }
開發者ID:hjgode,項目名稱:iTextSharpCF,代碼行數:10,代碼來源:RtfFontList.cs

示例6: RtfListLevel

 public RtfListLevel(RtfDocument doc, RtfList parent) : base(doc)
 {
     this.parent = parent;
     templateID = document.GetRandomInt();
     SetFontNumber( new RtfFont(document, new Font(Font.TIMES_ROMAN, 10, Font.NORMAL, new Color(0, 0, 0))));
     SetBulletFont(new Font(Font.SYMBOL, 10, Font.NORMAL, new Color(0, 0, 0)));
 }
開發者ID:nicecai,項目名稱:iTextSharp-4.1.6,代碼行數:7,代碼來源:RtfListLevel.cs

示例7: SetRtfDocument

 /**
 * Sets the RtfDocument this RtfPhrase belongs to. Also sets the RtfDocument for all child
 * elements.
 * 
 * @param doc The RtfDocument to use
 */
 public override void SetRtfDocument(RtfDocument doc) {
     base.SetRtfDocument(doc);
     for (int i = 0; i < this.chunks.Count; i++) {
         ((IRtfBasicElement) this.chunks[i]).SetRtfDocument(this.document);
     }
 }
開發者ID:nicecai,項目名稱:iTextSharp-4.1.6,代碼行數:12,代碼來源:RtfPhrase.cs

示例8: RtfPhrase

 /**
 * A basically empty constructor that is used by the RtfParagraph.
 * 
 * @param doc The RtfDocument this RtfPhrase belongs to.
 */
 protected internal RtfPhrase(RtfDocument doc) : base(doc) {
 }
開發者ID:nicecai,項目名稱:iTextSharp-4.1.6,代碼行數:7,代碼來源:RtfPhrase.cs

示例9: RtfCell

 /**
 * Constructs a RtfCell based on a Cell.
 *
 * @param doc The RtfDocument this RtfCell belongs to
 * @param row The RtfRow this RtfCell lies in
 * @param cell The PdfPCell to base this RtfCell on
 * @since 2.1.3
 */
 protected internal RtfCell(RtfDocument doc, RtfRow row, PdfPCell cell)
 {
     this.document = doc;
     this.parentRow = row;
     ImportCell(cell);
 }
開發者ID:bmictech,項目名稱:iTextSharp,代碼行數:14,代碼來源:RtfCell.cs

示例10: SetRtfDocument

 /**
 * Sets the RtfDocument this RtfColor belongs to
 * 
 * @param doc The RtfDocument to use
 */
 public override void SetRtfDocument(RtfDocument doc) {
     base.SetRtfDocument(doc);
     if (document != null) {
         this.colorNumber = document.GetDocumentHeader().GetColorNumber(this);
     }
 }
開發者ID:nicecai,項目名稱:iTextSharp-4.1.6,代碼行數:11,代碼來源:RtfColor.cs

示例11: RtfColor

 /**
 * Constructs a RtfColor based on the red/green/blue values
 * 
 * @param doc The RtfDocument this RtfColor belongs to
 * @param red The red value to use
 * @param green The green value to use
 * @param blue The blue value to use
 */
 public RtfColor(RtfDocument doc, int red, int green, int blue) : base(doc) {
     this.red = red;
     this.blue = blue;
     this.green = green;
     if (this.document != null) {
         this.colorNumber = this.document.GetDocumentHeader().GetColorNumber(this);
     }
 }
開發者ID:nicecai,項目名稱:iTextSharp-4.1.6,代碼行數:16,代碼來源:RtfColor.cs

示例12: RtfPictureList

 public RtfPictureList(RtfDocument doc) : base(doc) {
 }
開發者ID:nicecai,項目名稱:iTextSharp-4.1.6,代碼行數:2,代碼來源:RtfPictureList.cs

示例13: RtfListItem

 /**
 * Constructs a RtfListItem for a ListItem belonging to a RtfDocument.
 *
 * @param doc The RtfDocument this RtfListItem belongs to.
 * @param listItem The ListItem this RtfListItem is based on.
 */
 public RtfListItem(RtfDocument doc, ListItem listItem)
     : base(doc, listItem)
 {
 }
開發者ID:hjgode,項目名稱:iTextSharpCF,代碼行數:10,代碼來源:RtfListItem.cs

示例14: RtfChunk

        /**
        * Constructs a RtfChunk based on the content of a Chunk
        *
        * @param doc The RtfDocument that this Chunk belongs to
        * @param chunk The Chunk that this RtfChunk is based on
        */
        public RtfChunk(RtfDocument doc, Chunk chunk)
            : base(doc)
        {
            if (chunk == null) {
                return;
            }

            if (chunk.Attributes != null && chunk.Attributes[Chunk.SUBSUPSCRIPT] != null) {
                this.superSubScript = (float)chunk.Attributes[Chunk.SUBSUPSCRIPT];
            }
            if (chunk.Attributes != null && chunk.Attributes[Chunk.BACKGROUND] != null) {
                this.background = new RtfColor(this.document, (Color) ((Object[]) chunk.Attributes[Chunk.BACKGROUND])[0]);
            }
            font = new ST.RtfFont(doc, chunk.Font);
            content = chunk.Content;
        }
開發者ID:bmictech,項目名稱:iTextSharp,代碼行數:22,代碼來源:RtfChunk.cs

示例15: SetRtfDocument

 /**
 * Sets the RtfDocument this RtfChunk belongs to.
 *
 * @param doc The RtfDocument to use
 */
 public override void SetRtfDocument(RtfDocument doc)
 {
     base.SetRtfDocument(doc);
     this.font.SetRtfDocument(this.document);
 }
開發者ID:bmictech,項目名稱:iTextSharp,代碼行數:10,代碼來源:RtfChunk.cs


注:本文中的iTextSharp.text.rtf.document.RtfDocument類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。