本文整理汇总了C#中iTextSharp.text.Paragraph.AddAll方法的典型用法代码示例。如果您正苦于以下问题:C# Paragraph.AddAll方法的具体用法?C# Paragraph.AddAll怎么用?C# Paragraph.AddAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类iTextSharp.text.Paragraph
的用法示例。
在下文中一共展示了Paragraph.AddAll方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetElement
public static IElement GetElement(this DataTuple dt)
{
Paragraph p = new Paragraph();
// add colon if simple string
string label = dt.Label.AddDelimiter(':', s => s.EndsWithAlphanum());
p.AddAll(new IElement[] {
new Chunk(label, TextSharpFonts.ItemBoldFont),
new Chunk(dt.Value + " ", TextSharpFonts.ItemFont),
new Chunk(dt.Unit, TextSharpFonts.ItemFont)
});
return p;
}
示例2: End
/*
* (non-Javadoc)
*
* @see
* com.itextpdf.tool.xml.TagProcessor#endElement(com.itextpdf.tool.xml.Tag,
* java.util.List, com.itextpdf.text.Document)
*/
public override IList<IElement> End(IWorkerContext ctx, Tag tag, IList<IElement> currentContent) {
HtmlCell cell = new HtmlCell();
try {
HtmlPipelineContext htmlPipelineContext = GetHtmlPipelineContext(ctx);
cell = new HtmlCellCssApplier().Apply(cell, tag, htmlPipelineContext, htmlPipelineContext);
} catch (NoCustomContextException e1) {
throw new RuntimeWorkerException(LocaleMessages.GetInstance().GetMessage(LocaleMessages.NO_CUSTOM_CONTEXT), e1);
}
IList<IElement> l = new List<IElement>(1);
IList<IElement> chunks = new List<IElement>();
foreach (IElement e in currentContent) {
if (e is Chunk || e is NoNewLineParagraph || e is LineSeparator) {
if (e == Chunk.NEWLINE) {
int index = currentContent.IndexOf(e);
if (index == currentContent.Count - 1) {
continue;
} else {
IElement nextElement = currentContent[index + 1];
if (nextElement is Paragraph) {
continue;
}
if (chunks.Count == 0) {
continue;
}
}
} else if (e is LineSeparator) {
chunks.Add(Chunk.NEWLINE);
}
chunks.Add(e);
continue;
} else if (chunks.Count > 0) {
Paragraph p = new Paragraph();
p.MultipliedLeading = 1.2f;
p.AddAll(chunks);
p.Alignment = cell.HorizontalAlignment;
cell.AddElement(p);
chunks.Clear();
}
if (e is Paragraph) {
((Paragraph)e).Alignment = cell.HorizontalAlignment;
}
cell.AddElement(e);
}
if ( chunks.Count > 0 ) {
Paragraph p = new Paragraph();
p.MultipliedLeading = 1.2f;
p.AddAll(chunks);
p.Alignment = cell.HorizontalAlignment;
cell.AddElement(p);
}
l.Add(cell);
return l;
}
示例3: ProcessChunkItems
protected void ProcessChunkItems(IList<IElement> chunks, HtmlCell cell) {
Paragraph p = new Paragraph();
p.MultipliedLeading = 1.2f;
p.AddAll(chunks);
p.Alignment = cell.HorizontalAlignment;
if (p.Trim()) {
cell.AddElement(p);
}
chunks.Clear();
}