本文整理汇总了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) {
}
}
}