本文整理匯總了C#中iTextSharp.text.Chunk.SetTextExpansion方法的典型用法代碼示例。如果您正苦於以下問題:C# Chunk.SetTextExpansion方法的具體用法?C# Chunk.SetTextExpansion怎麽用?C# Chunk.SetTextExpansion使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類iTextSharp.text.Chunk
的用法示例。
在下文中一共展示了Chunk.SetTextExpansion方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ImageTaggingExpansionTest
public void ImageTaggingExpansionTest() {
String filename = "TextExpansionTest.pdf";
Document doc = new Document(PageSize.LETTER, 72, 72, 72, 72);
PdfWriter writer = PdfWriter.GetInstance(doc, new FileStream(DEST_FOLDER + filename, FileMode.Create));
writer.SetTagged();
doc.Open();
Chunk c1 = new Chunk("ABC");
c1.SetTextExpansion("the alphabet");
Paragraph p1 = new Paragraph();
p1.Add(c1);
doc.Add(p1);
PdfTemplate t = writer.DirectContent.CreateTemplate(6, 6);
t.SetLineWidth(1f);
t.Circle(3f, 3f, 1.5f);
t.SetGrayFill(0);
t.FillStroke();
Image i = Image.GetInstance(t);
Chunk c2 = new Chunk(i, 100, -100);
doc.Add(c2);
Chunk c3 = new Chunk("foobar");
c3.SetTextExpansion("bar bar bar");
Paragraph p3 = new Paragraph();
p3.Add(c3);
doc.Add(p3);
doc.Close();
CompareTool compareTool = new CompareTool();
String error = compareTool.CompareByContent(DEST_FOLDER + filename, SOURCE_FOLDER + "cmp_" + filename, DEST_FOLDER, "diff_");
if (error != null) {
Assert.Fail(error);
}
}