当前位置: 首页>>代码示例>>C#>>正文


C# Paragraph.HasLeading方法代码示例

本文整理汇总了C#中iTextSharp.text.Paragraph.HasLeading方法的典型用法代码示例。如果您正苦于以下问题:C# Paragraph.HasLeading方法的具体用法?C# Paragraph.HasLeading怎么用?C# Paragraph.HasLeading使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在iTextSharp.text.Paragraph的用法示例。


在下文中一共展示了Paragraph.HasLeading方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的iTextSharp.text.Paragraph.HasLeading方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。