当前位置: 首页>>代码示例>>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;未经允许,请勿转载。