本文整理匯總了C#中iTextSharp.text.pdf.PdfPRow.SetWidths方法的典型用法代碼示例。如果您正苦於以下問題:C# PdfPRow.SetWidths方法的具體用法?C# PdfPRow.SetWidths怎麽用?C# PdfPRow.SetWidths使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類iTextSharp.text.pdf.PdfPRow
的用法示例。
在下文中一共展示了PdfPRow.SetWidths方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: AddCell
/**
* Adds a cell element.
*
* @param cell the cell element
*/
virtual public PdfPCell AddCell(PdfPCell cell)
{
rowCompleted = false;
PdfPCell ncell;
if (cell is PdfPHeaderCell)
ncell = new PdfPHeaderCell((PdfPHeaderCell)cell);
else
ncell = new PdfPCell(cell);
int colspan = ncell.Colspan;
colspan = Math.Max(colspan, 1);
colspan = Math.Min(colspan, currentRow.Length - currentColIdx);
ncell.Colspan = colspan;
if (colspan != 1)
isColspan = true;
int rdir = ncell.RunDirection;
if (rdir == PdfWriter.RUN_DIRECTION_DEFAULT)
ncell.RunDirection = runDirection;
SkipColsWithRowspanAbove();
bool cellAdded = false;
if (currentColIdx < currentRow.Length)
{
currentRow[currentColIdx] = ncell;
currentColIdx += colspan;
cellAdded = true;
}
SkipColsWithRowspanAbove();
while (currentColIdx >= currentRow.Length)
{
int numCols = NumberOfColumns;
if (runDirection == PdfWriter.RUN_DIRECTION_RTL)
{
PdfPCell[] rtlRow = new PdfPCell[numCols];
int rev = currentRow.Length;
for (int k = 0; k < currentRow.Length; ++k)
{
PdfPCell rcell = currentRow[k];
int cspan = rcell.Colspan;
rev -= cspan;
rtlRow[rev] = rcell;
k += cspan - 1;
}
currentRow = rtlRow;
}
PdfPRow row = new PdfPRow(currentRow);
if (totalWidth > 0)
{
row.SetWidths(absoluteWidths);
totalHeight += row.MaxHeights;
}
rows.Add(row);
currentRow = new PdfPCell[numCols];
currentColIdx = 0;
SkipColsWithRowspanAbove();
rowCompleted = true;
}
if (!cellAdded)
{
currentRow[currentColIdx] = ncell;
currentColIdx += colspan;
}
return ncell;
}
示例2: AddCell
/** Adds a cell element.
* @param cell the cell element
*/
public void AddCell(PdfPCell cell)
{
PdfPCell ncell = new PdfPCell(cell);
int colspan = ncell.Colspan;
colspan = Math.Max(colspan, 1);
colspan = Math.Min(colspan, currentRow.Length - currentRowIdx);
ncell.Colspan = colspan;
if (colspan != 1)
isColspan = true;
int rdir = ncell.RunDirection;
if (rdir == PdfWriter.RUN_DIRECTION_DEFAULT)
ncell.RunDirection = runDirection;
currentRow[currentRowIdx] = ncell;
currentRowIdx += colspan;
if (currentRowIdx >= currentRow.Length) {
if (runDirection == PdfWriter.RUN_DIRECTION_RTL) {
PdfPCell[] rtlRow = new PdfPCell[absoluteWidths.Length];
int rev = currentRow.Length;
for (int k = 0; k < currentRow.Length; ++k) {
PdfPCell rcell = currentRow[k];
int cspan = rcell.Colspan;
rev -= cspan;
rtlRow[rev] = rcell;
k += cspan - 1;
}
currentRow = rtlRow;
}
PdfPRow row = new PdfPRow(currentRow);
if (totalWidth > 0) {
row.SetWidths(absoluteWidths);
totalHeight += row.MaxHeights;
}
rows.Add(row);
currentRow = new PdfPCell[absoluteWidths.Length];
currentRowIdx = 0;
}
}