本文整理匯總了C#中iTextSharp.text.pdf.PdfPTable.DeleteLastRow方法的典型用法代碼示例。如果您正苦於以下問題:C# PdfPTable.DeleteLastRow方法的具體用法?C# PdfPTable.DeleteLastRow怎麽用?C# PdfPTable.DeleteLastRow使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類iTextSharp.text.pdf.PdfPTable
的用法示例。
在下文中一共展示了PdfPTable.DeleteLastRow方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: DrawTableRow
/// <summary>
/// Add a row of pdfpcell to table.
/// return True, current page have enought size for that row
/// return False, current page not enought size for that row, row will be remove and need to draw on
/// next page
/// 20130606 :: jaimelopez :: mellorasinxelas to support absolute footer.
/// </summary>
/// <param name="table"></param>
/// <param name="tableRowElement"></param>
/// <param name="data"></param>
/// <returns></returns>
protected bool DrawTableRow(
PdfPTable table,
TableRow tableRowElement,
IDictionary data)
{
bool enoughSpace = true;
PDFDrawItextSharp.PDFDrawItextSharp pdfDraw = (PDFDrawItextSharp.PDFDrawItextSharp)pdfDrawer;
foreach (TableCell tableCell in tableRowElement.TableCells)
{
PdfPCell cell = pdfDraw.CreateTableCell(tableCell.Attributes, data);
foreach (DrawElement drawElement in tableCell.DrawElements)
{
if (drawElement is TextBox)
{
//iTextSharp.text.Phrase phrase = _pdfDraw.CreatePhrase(
// ((PDFTemplate.TextBox)drawElement).GetText(data), drawElement.FontAttributes);
Paragraph paragraph = pdfDraw.CreateParagraph(((TextBox)drawElement).GetText(data), drawElement.FontAttributes);
paragraph.Alignment = PDFDrawItextSharpHelper.Align(Helper.GetAttributeValue("align", drawElement.Attributes, "Left"));
cell.AddElement(paragraph);
}
else if (drawElement is PDFTemplate.Image)
{
iTextSharp.text.Image image = pdfDraw.CreateImageFromAttribute(drawElement.Attributes);
image.Alignment = PDFDrawItextSharpHelper.Align(Helper.GetAttributeValue("align", drawElement.Attributes, "Left"));
cell.AddElement(image);
}
}
table.AddCell(cell);
}
table.CompleteRow();
//if(table.row
//fixme need to check if any row span
if (pdfDrawer.isNoMoreY(table.TotalHeight, DocumentGroup.Table))
{
enoughSpace = false;
table.DeleteLastRow();
}
return enoughSpace;
}