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


C# PdfPRow.SetWidths方法代碼示例

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

示例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;
     }
 }
開發者ID:hjgode,項目名稱:iTextSharpCF,代碼行數:40,代碼來源:PdfPTable.cs


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