本文整理匯總了C#中iTextSharp.text.pdf.parser.TextRenderInfo.GetCharacterRenderInfos方法的典型用法代碼示例。如果您正苦於以下問題:C# TextRenderInfo.GetCharacterRenderInfos方法的具體用法?C# TextRenderInfo.GetCharacterRenderInfos怎麽用?C# TextRenderInfo.GetCharacterRenderInfos使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類iTextSharp.text.pdf.parser.TextRenderInfo
的用法示例。
在下文中一共展示了TextRenderInfo.GetCharacterRenderInfos方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: RenderText
public void RenderText(TextRenderInfo renderInfo)
{
List<TextRenderInfo> subs = renderInfo.GetCharacterRenderInfos();
TextRenderInfo previousCharInfo = subs[0];
for (int i = 1; i < subs.Count; i++)
{
TextRenderInfo charInfo = subs[i];
Vector previousEndPoint = previousCharInfo.GetBaseline().GetEndPoint();
Vector currentStartPoint = charInfo.GetBaseline().GetStartPoint();
AssertVectorsEqual(previousEndPoint, currentStartPoint, charInfo.GetText());
previousCharInfo = charInfo;
}
}
示例2: RenderText
//Automatically called for each chunk of text in the PDF
public override void RenderText(TextRenderInfo renderInfo)
{
base.RenderText(renderInfo);
//See if the current chunk contains the text
var startPosition = System.Globalization.CultureInfo.CurrentCulture.CompareInfo.IndexOf(
renderInfo.GetText(), this.TextToSearchFor, this.CompareOptions);
//If not found bail
if (startPosition < 0)
{
return;
}
if (renderInfo.PdfString.ToString() != this.TextToSearchFor)
{
return;
}
//Grab the individual characters
var chars =
renderInfo.GetCharacterRenderInfos().Skip(startPosition).Take(this.TextToSearchFor.Length).ToList();
//Grab the first and last character
var firstChar = chars.First();
var lastChar = chars.Last();
//Get the bounding box for the chunk of text
var bottomLeft = firstChar.GetDescentLine().GetStartPoint();
var topRight = lastChar.GetAscentLine().GetEndPoint();
//Create a rectangle from it
var rect = new iTextSharp.text.Rectangle(
bottomLeft[Vector.I1],
bottomLeft[Vector.I2],
topRight[Vector.I1],
topRight[Vector.I2]
);
//Add this to our main collection
this.MyPoints.Add(new RectAndText(rect, this.TextToSearchFor));
}
示例3: RenderText
public virtual void RenderText(TextRenderInfo renderInfo) {
if (renderInfo.PdfString.ToUnicodeString().Length == 0) {
return;
}
// if true, than clipping path was completely cleaned
if (newClippingPath.IsEmpty()) {
LineSegment baseline = renderInfo.GetUnscaledBaseline();
chunks.Add(new PdfCleanUpContentChunk.Text(renderInfo.PdfString, baseline.GetStartPoint(),
baseline.GetEndPoint(), false, strNumber));
} else {
foreach (TextRenderInfo ri in renderInfo.GetCharacterRenderInfos()) {
bool isAllowed = filter.AllowText(ri);
LineSegment baseline = ri.GetUnscaledBaseline();
chunks.Add(new PdfCleanUpContentChunk.Text(ri.PdfString, baseline.GetStartPoint(),
baseline.GetEndPoint(), isAllowed, strNumber));
}
}
++strNumber;
}
示例4: RenderText
public override void RenderText(TextRenderInfo renderInfo) {
foreach (TextRenderInfo tri in renderInfo.GetCharacterRenderInfos())
base.RenderText(tri);
}
示例5: RenderText
public virtual void RenderText(TextRenderInfo renderInfo) {
if (renderInfo.PdfString.ToUnicodeString().Length == 0) {
return;
}
foreach (TextRenderInfo ri in renderInfo.GetCharacterRenderInfos()) {
bool isAllowed = filter.AllowText(ri);
LineSegment baseline = ri.GetUnscaledBaseline();
chunks.Add(new PdfCleanUpContentChunk.Text(ri.PdfString, baseline.GetStartPoint(),
baseline.GetEndPoint(), isAllowed, strNumber));
}
++strNumber;
}