本文整理匯總了C#中iTextSharp.text.pdf.PdfPCell.AddHeader方法的典型用法代碼示例。如果您正苦於以下問題:C# PdfPCell.AddHeader方法的具體用法?C# PdfPCell.AddHeader怎麽用?C# PdfPCell.AddHeader使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類iTextSharp.text.pdf.PdfPCell
的用法示例。
在下文中一共展示了PdfPCell.AddHeader方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: CreateTaggedPdf17
public void CreateTaggedPdf17() {
InitializeDocument("17");
PdfPTable table = new PdfPTable(2);
PdfPCell cell = new PdfPCell(new Paragraph("h1"));
cell.Colspan = 2;
table.AddCell(cell);
cell = new PdfPCell(new Paragraph("h2"));
cell.Colspan = 2;
table.AddCell(cell);
cell = new PdfPCell(new Paragraph("footer 1"));
cell.Colspan = 2;
table.AddCell(cell);
cell = new PdfPCell(new Paragraph("footer 2"));
cell.Colspan = 2;
table.AddCell(cell);
table.HeaderRows = 4;
table.FooterRows = 2;
try {
PdfPHeaderCell headerCell = null, headerCell2 = null;
cell = null;
for (int i = 1; i <= 2; i++) {
if (i == 1) {
headerCell = new PdfPHeaderCell();
headerCell.Scope = PdfPHeaderCell.ROW;
headerCell.Phrase = new Phrase("header1");
headerCell.Name = "header1";
table.AddCell(headerCell);
headerCell2 = new PdfPHeaderCell();
headerCell2.Scope = PdfPHeaderCell.ROW;
headerCell2.Phrase = new Phrase("header2");
headerCell2.Name = "header2";
table.AddCell(headerCell2);
}
else {
cell = new PdfPCell(new Phrase("row " + i + ", coumn 1"));
cell.AddHeader(headerCell);
table.AddCell(cell);
cell = new PdfPCell(new Phrase("row " + i + ", coumn 2"));
cell.AddHeader(headerCell2);
cell.AddHeader(headerCell2);
table.AddCell(cell);
}
}
}
catch (Exception e) {
Trace.WriteLine(e.Message);
}
document.Add(table);
document.Close();
int[] nums = new int[] {27};
CheckNums(nums);
CompareResults("17");
}