本文整理匯總了C#中iTextSharp.text.pdf.PdfPRow.GetCells方法的典型用法代碼示例。如果您正苦於以下問題:C# PdfPRow.GetCells方法的具體用法?C# PdfPRow.GetCells怎麽用?C# PdfPRow.GetCells使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類iTextSharp.text.pdf.PdfPRow
的用法示例。
在下文中一共展示了PdfPRow.GetCells方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: AdjustCellsInRow
/**
* Calculates the extra height needed in a row because of rowspans.
* @param start the index of the start row (the one to adjust)
* @param end the index of the end row on the page
* @since 2.1.6
*/
virtual protected PdfPRow AdjustCellsInRow(int start, int end)
{
PdfPRow row = GetRow(start);
if (row.Adjusted) return row;
row = new PdfPRow(row);
PdfPCell cell;
PdfPCell[] cells = row.GetCells();
for (int i = 0; i < cells.Length; i++)
{
cell = cells[i];
if (cell == null || cell.Rowspan == 1)
continue;
int stop = Math.Min(end, start + cell.Rowspan);
float extra = 0;
for (int k = start + 1; k < stop; k++)
{
extra += GetRow(k).MaxHeights;
}
row.SetExtraHeight(i, extra);
}
row.Adjusted = true;
return row;
}
示例2: ImportRow
/**
* Imports a PdfPRow and copies all settings
*
* @param row The PdfPRow to import
* @since 2.1.3
*/
private void ImportRow(PdfPRow row) {
this.cells = new ArrayList();
this.width = this.document.GetDocumentHeader().GetPageSetting().GetPageWidth() - this.document.GetDocumentHeader().GetPageSetting().GetMarginLeft() - this.document.GetDocumentHeader().GetPageSetting().GetMarginRight();
this.width = (int) (this.width * this.parentTable.GetTableWidthPercent() / 100);
int cellRight = 0;
int cellWidth = 0;
PdfPCell[] cells = row.GetCells();
for (int i = 0; i < cells.Length; i++) {
cellWidth = (int) (this.width * this.parentTable.GetProportionalWidths()[i] / 100);
cellRight = cellRight + cellWidth;
PdfPCell cell = cells[i];
RtfCell rtfCell = new RtfCell(this.document, this, cell);
rtfCell.SetCellRight(cellRight);
rtfCell.SetCellWidth(cellWidth);
this.cells.Add(rtfCell);
}
}