示例#1
0
 /** Constructs a deep copy of a <CODE>PdfPCell</CODE>.
  * @param cell the <CODE>PdfPCell</CODE> to duplicate
  */
 public PdfPCell(PdfPCell cell) : base(cell.llx, cell.lly, cell.urx, cell.ury)
 {
     CloneNonPositionParameters(cell);
     verticalAlignment = cell.verticalAlignment;
     paddingLeft       = cell.paddingLeft;
     paddingRight      = cell.paddingRight;
     paddingTop        = cell.paddingTop;
     paddingBottom     = cell.paddingBottom;
     phrase            = cell.phrase;
     fixedHeight       = cell.fixedHeight;
     minimumHeight     = cell.minimumHeight;
     noWrap            = cell.noWrap;
     colspan           = cell.colspan;
     rowspan           = cell.rowspan;
     if (cell.table != null)
     {
         table = new PdfPTable(cell.table);
     }
     image            = Image.GetInstance(cell.image);
     cellEvent        = cell.cellEvent;
     useDescender     = cell.useDescender;
     column           = ColumnText.Duplicate(cell.column);
     useBorderPadding = cell.useBorderPadding;
     rotation         = cell.rotation;
     id   = cell.id;
     role = cell.role;
     if (cell.accessibleAttributes != null)
     {
         accessibleAttributes = new Dictionary <PdfName, PdfObject>(cell.accessibleAttributes);
     }
     headers = cell.headers;
 }
示例#2
0
 /**
  * Makes a copy of an existing row.
  *
  * @param row
  */
 public PdfPRow(PdfPRow row)
 {
     mayNotBreak = row.mayNotBreak;
     maxHeight   = row.maxHeight;
     calculated  = row.calculated;
     cells       = new PdfPCell[row.cells.Length];
     for (int k = 0; k < cells.Length; ++k)
     {
         if (row.cells[k] != null)
         {
             if (row.cells[k] is PdfPHeaderCell)
             {
                 cells[k] = new PdfPHeaderCell((PdfPHeaderCell)row.cells[k]);
             }
             else
             {
                 cells[k] = new PdfPCell(row.cells[k]);
             }
         }
     }
     widths = new float[cells.Length];
     System.Array.Copy(row.widths, 0, widths, 0, cells.Length);
     InitExtraHeights();
     this.id   = row.ID;
     this.role = row.Role;
     if (row.accessibleAttributes != null)
     {
         this.accessibleAttributes = new Dictionary <PdfName, PdfObject>(row.GetAccessibleAttributes());
     }
 }
示例#3
0
 public PdfPRow(PdfPCell[] cells, PdfPRow source)
 {
     this.cells = cells;
     widths     = new float[cells.Length];
     InitExtraHeights();
     if (source != null)
     {
         this.id   = source.ID;
         this.role = source.Role;
         if (source.accessibleAttributes != null)
         {
             this.accessibleAttributes = new Dictionary <PdfName, PdfObject>(source.GetAccessibleAttributes());
         }
     }
 }
示例#4
0
        /**
        * Copies the format of the sourceTable without copying the content. 
        * @param sourceTable
        * @since 2.1.6 private is now protected
        */

        virtual protected internal void CopyFormat(PdfPTable sourceTable)
        {
            relativeWidths = new float[sourceTable.NumberOfColumns];
            absoluteWidths = new float[sourceTable.NumberOfColumns];
            System.Array.Copy(sourceTable.relativeWidths, 0, relativeWidths, 0, NumberOfColumns);
            System.Array.Copy(sourceTable.absoluteWidths, 0, absoluteWidths, 0, NumberOfColumns);
            totalWidth = sourceTable.totalWidth;
            totalHeight = sourceTable.totalHeight;
            currentColIdx = 0;
            tableEvent = sourceTable.tableEvent;
            runDirection = sourceTable.runDirection;
            if (sourceTable.defaultCell is PdfPHeaderCell)
                defaultCell = new PdfPHeaderCell((PdfPHeaderCell)sourceTable.defaultCell);
            else
                defaultCell = new PdfPCell(sourceTable.defaultCell);
            currentRow = new PdfPCell[sourceTable.currentRow.Length];
            isColspan = sourceTable.isColspan;
            splitRows = sourceTable.splitRows;
            spacingAfter = sourceTable.spacingAfter;
            spacingBefore = sourceTable.spacingBefore;
            headerRows = sourceTable.headerRows;
            footerRows = sourceTable.footerRows;
            lockedWidth = sourceTable.lockedWidth;
            extendLastRow = sourceTable.extendLastRow;
            headersInEvent = sourceTable.headersInEvent;
            widthPercentage = sourceTable.widthPercentage;
            splitLate = sourceTable.splitLate;
            skipFirstHeader = sourceTable.skipFirstHeader;
            skipLastFooter = sourceTable.skipLastFooter;
            horizontalAlignment = sourceTable.horizontalAlignment;
            keepTogether = sourceTable.keepTogether;
            complete = sourceTable.complete;
            loopCheck = sourceTable.loopCheck;
            id = sourceTable.ID;
            role = sourceTable.Role;
            if (sourceTable.accessibleAttributes != null)
                accessibleAttributes = new Dictionary<PdfName, PdfObject>(sourceTable.accessibleAttributes);
            header = sourceTable.GetHeader();
            body = sourceTable.GetBody();
            footer = sourceTable.GetFooter();
        }
示例#5
0
 /**
 * Makes a copy of an existing row.
 * 
 * @param row
 */
 public PdfPRow(PdfPRow row) {
     mayNotBreak = row.mayNotBreak;
     maxHeight = row.maxHeight;
     calculated = row.calculated;
     cells = new PdfPCell[row.cells.Length];
     for (int k = 0; k < cells.Length; ++k) {
         if (row.cells[k] != null)
         {
             if (row.cells[k] is PdfPHeaderCell)
                 cells[k] = new PdfPHeaderCell((PdfPHeaderCell)row.cells[k]);
             else
                 cells[k] = new PdfPCell(row.cells[k]);
         }
     }
     widths = new float[cells.Length];
     System.Array.Copy(row.widths, 0, widths, 0, cells.Length);
     InitExtraHeights();
     this.id = row.ID;
     this.role = row.Role;
     if (row.accessibleAttributes != null)
         this.accessibleAttributes = new Dictionary<PdfName, PdfObject>(row.GetAccessibleAttributes());
 }
示例#6
0
 public PdfPRow(PdfPCell[] cells, PdfPRow source) {
     this.cells = cells;
     widths = new float[cells.Length];
     InitExtraHeights();
     if (source != null) {
         this.id = source.ID;
         this.role = source.Role;
         if (source.accessibleAttributes != null)
             this.accessibleAttributes = new Dictionary<PdfName, PdfObject>(source.GetAccessibleAttributes());
     }
 }
示例#7
0
文件: Chunk.cs 项目: Gianluigi/dssnet
 /**
 * A <CODE>Chunk</CODE> copy constructor.
 * @param ck the <CODE>Chunk</CODE> to be copied
 */    
 public Chunk(Chunk ck) {
     if (ck.content != null) {
         content = new StringBuilder(ck.content.ToString());
     }
     if (ck.font != null) {
         font = new Font(ck.font);
     }
     if (ck.attributes != null) {
         attributes = new Dictionary<String,object>(ck.attributes);
     }
     role = ck.role;
     if (ck.accessibleAttributes != null)
     {
         accessibleAttributes = new Dictionary<PdfName, PdfObject>(ck.accessibleAttributes);
     }
     id = ck.ID;
 }
示例#8
0
 /** Constructs a deep copy of a <CODE>PdfPCell</CODE>.
 * @param cell the <CODE>PdfPCell</CODE> to duplicate
 */
 public PdfPCell(PdfPCell cell) : base(cell.llx, cell.lly, cell.urx, cell.ury) {
     CloneNonPositionParameters(cell);
     verticalAlignment = cell.verticalAlignment;
     paddingLeft = cell.paddingLeft;
     paddingRight = cell.paddingRight;
     paddingTop = cell.paddingTop;
     paddingBottom = cell.paddingBottom;
     phrase = cell.phrase;
     fixedHeight = cell.fixedHeight;
     minimumHeight = cell.minimumHeight;
     noWrap = cell.noWrap;
     colspan = cell.colspan;
     rowspan = cell.rowspan;
     if (cell.table != null)
         table = new PdfPTable(cell.table);
     image = Image.GetInstance(cell.image);
     cellEvent = cell.cellEvent;
     useDescender = cell.useDescender;
     column = ColumnText.Duplicate(cell.column);
     useBorderPadding = cell.useBorderPadding;
     rotation = cell.rotation;
     id = cell.id;
     role = cell.role;
     if (cell.accessibleAttributes != null)
         accessibleAttributes = new Dictionary<PdfName, PdfObject>(cell.accessibleAttributes);
     headers = cell.headers;
 }
 /// <summary>
 /// Constructs a Paragraph with a certain Phrase.
 /// </summary>
 /// <param name="phrase">a Phrase</param>
 public Paragraph(Phrase phrase) : base(phrase) {
     if (phrase is Paragraph) {
         Paragraph p = (Paragraph)phrase;
         Alignment = p.Alignment;
         IndentationLeft = p.IndentationLeft;
         IndentationRight = p.IndentationRight;
         FirstLineIndent = p.FirstLineIndent;
         SpacingAfter = p.SpacingAfter;
         SpacingBefore = p.SpacingBefore;
         ExtraParagraphSpace = p.ExtraParagraphSpace;
         Role = p.role;
         id = p.ID;
         if (p.accessibleAttributes != null)
             accessibleAttributes = new Dictionary<PdfName, PdfObject>(p.accessibleAttributes);
     }
 }