本文整理匯總了C#中iTextSharp.text.Paragraph.Insert方法的典型用法代碼示例。如果您正苦於以下問題:C# Paragraph.Insert方法的具體用法?C# Paragraph.Insert怎麽用?C# Paragraph.Insert使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類iTextSharp.text.Paragraph
的用法示例。
在下文中一共展示了Paragraph.Insert方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ConstructTitle
/**
* Constructs a Paragraph that will be used as title for a Section or Chapter.
* @param title the title of the section
* @param numbers a list of sectionnumbers
* @param numberDepth how many numbers have to be shown
* @param numberStyle the numbering style
* @return a Paragraph object
* @since iText 2.0.8
*/
public static Paragraph ConstructTitle(Paragraph title, ArrayList numbers, int numberDepth, int numberStyle)
{
if (title == null) {
return null;
}
int depth = Math.Min(numbers.Count, numberDepth);
if (depth < 1) {
return title;
}
StringBuilder buf = new StringBuilder(" ");
for (int i = 0; i < depth; i++) {
buf.Insert(0, ".");
buf.Insert(0, (int)numbers[i]);
}
if (numberStyle == NUMBERSTYLE_DOTTED_WITHOUT_FINAL_DOT) {
buf.Remove(buf.Length - 2, 1);
}
Paragraph result = new Paragraph(title);
result.Insert(0, new Chunk(buf.ToString(), title.Font));
return result;
}