public void flush() { super.addCell( tableCell ); } }
public StylableTable( StylableDocument ownerDocument, IStylableContainer parent, int numColumns ) { super( numColumns ); // cancel ExtendedPdfPTable settings // we raise text in StylableParagraph so extra spacing here is unnecessary super.setSpacingBefore( 0.0f ); // default is split rows early super.setSplitLate( false ); this.ownerDocument = ownerDocument; this.parent = parent; }
private PdfPCell getWrapperCell() { if ( wrapperCell == null ) { wrapperCell = createCell(); } return wrapperCell; }
super.setTotalWidth( tableProperties.getWidth() ); if ( alignment != Element.ALIGN_UNDEFINED ) super.setHorizontalAlignment( alignment ); if ( margin != null && margin > 0.0f ) super.setPadding( margin ); super.setPaddingLeft( marginLeft ); super.setPaddingRight( marginRight ); super.setPaddingTop( marginTop ); super.setPaddingBottom( marginBottom ); if ( mayBreakBetweenRows != null ) super.setKeepTogether( !mayBreakBetweenRows ); if ( super.isSplitLate() == false && keepTogether == true ) super.setSplitLate( true );
private PdfPTable createTable( PdfPCell cell ) { PdfPTable table = new PdfPTable( 1 ); table.setSpacingBefore( this.spacingBefore() ); table.setSpacingAfter( this.spacingAfter() ); table.setHorizontalAlignment( this.getHorizontalAlignment() ); table.setTotalWidth( cell.getPaddingLeft() + this.getTotalWidth() + cell.getPaddingRight() ); table.setLockedWidth( true ); table.setSplitLate( false ); table.addCell( cell ); return table; }
public MasterPageHeaderFooter() { super( 1 ); super.setTotalWidth( 1000 ); super.setWidthPercentage( 100f ); tableCell = new ExtendedPdfPCell(); tableCell.disableBorderSide( Rectangle.BOX ); }
public void applyStyles(Style style) { this.lastStyleApplied = style; StyleTableProperties tableProperties = style.getTableProperties(); if (tableProperties != null) { if (tableProperties.getWidth() != null) { super.setTotalWidth(tableProperties.getWidth()); super.setLockedWidth(true); } } }
/** * Sets the padding of the contents in the cell (space between content and border). * * @param padding */ public void setPadding( float padding ) { getWrapperCell().setPadding( padding ); }
for ( int i = 0; i < relativeWidths.length; i++ ) if ( !rowSpanAbove( idx, i ) ) continue; int rs = 1; while ( rowSpanAbove( idx - rs, i ) ) while ( rs > 0 ) tmp -= getRowHeight( idx - rs ); rs--;
public StylableTable( StylableDocument ownerDocument, IITextContainer parent, int numColumns ) { super( numColumns ); this.ownerDocument = ownerDocument; this.parent = parent; // Ugly code to resolve this problem : When Paragraph is before // PDFTable, space before paragraph and table is // too little and paragraph content cut the table. // Add spacing before to resolve that. super.setSpacingBefore( 5f ); }
public float getRowHeight( int idx ) { return getRowHeight( idx, false ); }
public Element getElement() { if ( wrapperTable != null ) { return wrapperTable; } else if ( wrapperCell != null ) { wrapperCell.addElement( this ); wrapperTable = createTable( wrapperCell ); return wrapperTable; } return this; } }
boolean rowSpanAbove( int currRow, int currCol ) if ( ( currCol >= getNumberOfColumns() ) || ( currCol < 0 ) || ( currRow == 0 ) ) return false;
super.setTotalWidth( tableProperties.getWidth() ); if ( alignment != Element.ALIGN_UNDEFINED ) super.setHorizontalAlignment( alignment ); if ( margin != null && margin > 0.0f ) super.setPadding( margin ); super.setPaddingLeft( marginLeft ); super.setPaddingRight( marginRight ); super.setPaddingTop( marginTop ); super.setPaddingBottom( marginBottom ); if ( mayBreakBetweenRows != null ) super.setKeepTogether( !mayBreakBetweenRows ); if ( super.isSplitLate() == false && keepTogether == true ) super.setSplitLate( true );
private PdfPTable createTable( PdfPCell cell ) { PdfPTable table = new PdfPTable( 1 ); table.setSpacingBefore( this.spacingBefore() ); table.setSpacingAfter( this.spacingAfter() ); table.setHorizontalAlignment( this.getHorizontalAlignment() ); table.setTotalWidth( cell.getPaddingLeft() + this.getTotalWidth() + cell.getPaddingRight() ); table.setLockedWidth( true ); table.setSplitLate( false ); table.addCell( cell ); return table; }
public MasterPageHeaderFooter() { super( 1 ); super.setTotalWidth( 1000 ); super.setWidthPercentage( 100f ); tableCell = new ExtendedPdfPCell(); tableCell.disableBorderSide( Rectangle.BOX ); }
public void applyStyles( XWPFTable ele, Style style ) { this.lastStyleApplied = style; if ( style != null ) { StyleTableProperties tableProperties = style.getTableProperties(); if ( tableProperties != null ) { if ( tableProperties.getWidth() != null ) { super.setTotalWidth( tableProperties.getWidth() ); super.setLockedWidth( true ); } } } }
/** * Setter for property paddingTop. * * @param paddingTop New value of property paddingTop. */ public void setPaddingTop( float paddingTop ) { getWrapperCell().setPaddingTop( paddingTop ); }
for ( int i = 0; i < relativeWidths.length; i++ ) if ( !rowSpanAbove( idx, i ) ) continue; int rs = 1; while ( rowSpanAbove( idx - rs, i ) ) while ( rs > 0 ) tmp -= getRowHeight( idx - rs ); rs--;
public StylableTable( StylableDocument ownerDocument, IITextContainer parent, int numColumns ) { super( numColumns ); this.ownerDocument = ownerDocument; this.parent = parent; // Ugly code to resolve this problem : When Paragraph is before // PDFTable, space before paragraph and table is // too little and paragraph content cut the table. // Add spacing before to resolve that. super.setSpacingBefore( 5f ); }