本文整理汇总了C#中iTextSharp.text.Chunk.IsEmpty方法的典型用法代码示例。如果您正苦于以下问题:C# Chunk.IsEmpty方法的具体用法?C# Chunk.IsEmpty怎么用?C# Chunk.IsEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类iTextSharp.text.Chunk
的用法示例。
在下文中一共展示了Chunk.IsEmpty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddChunk
/// <summary>
/// Adds a Chunk.
/// </summary>
/// <remarks>
/// This method is a hack to solve a problem I had with phrases that were split between chunks
/// in the wrong place.
/// </remarks>
/// <param name="chunk">a Chunk</param>
/// <returns>a bool</returns>
protected bool AddChunk(Chunk chunk) {
Font f = chunk.Font;
String c = chunk.Content;
if (font != null && !font.IsStandardFont()) {
f = font.Difference(chunk.Font);
}
if (Count > 0 && !chunk.HasAttributes()) {
try {
Chunk previous = (Chunk) this[Count - 1];
if (!previous.HasAttributes()
&& (f == null
|| f.CompareTo(previous.Font) == 0)
&& previous.Font.CompareTo(f) == 0
&& !"".Equals(previous.Content.Trim())
&& !"".Equals(c.Trim())) {
previous.Append(c);
return true;
}
}
catch {
}
}
Chunk newChunk = new Chunk(c, f);
newChunk.Attributes = chunk.Attributes;
if (hyphenation != null && newChunk.GetHyphenation() == null && !newChunk.IsEmpty()) {
newChunk.SetHyphenation(hyphenation);
}
base.Add(newChunk);
return true;
}
示例2: ApplyAnchor
/**
* Applies the properties of the Anchor to a Chunk.
* @param chunk the Chunk (part of the Anchor)
* @param notGotoOK if true, this chunk will determine the local destination
* @param localDestination true if the chunk is a local goto and the reference a local destination
* @return the value of notGotoOK or false, if a previous Chunk was used to determine the local destination
*/
protected bool ApplyAnchor(Chunk chunk, bool notGotoOK, bool localDestination) {
if (name != null && notGotoOK && !chunk.IsEmpty()) {
chunk.SetLocalDestination(name);
notGotoOK = false;
}
if (localDestination) {
chunk.SetLocalGoto(reference.Substring(1));
} else if (reference != null)
chunk.SetAnchor(reference);
return notGotoOK;
}