當前位置: 首頁>>代碼示例>>C#>>正文


C# PdfPRow.GetCells方法代碼示例

本文整理匯總了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;
        }
開發者ID:,項目名稱:,代碼行數:30,代碼來源:

示例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);
     }
 }
開發者ID:nicecai,項目名稱:iTextSharp-4.1.6,代碼行數:25,代碼來源:RtfRow.cs


注:本文中的iTextSharp.text.pdf.PdfPRow.GetCells方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。