本文整理汇总了Java中com.itextpdf.text.pdf.PdfPCell.setPaddingRight方法的典型用法代码示例。如果您正苦于以下问题:Java PdfPCell.setPaddingRight方法的具体用法?Java PdfPCell.setPaddingRight怎么用?Java PdfPCell.setPaddingRight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.itextpdf.text.pdf.PdfPCell
的用法示例。
在下文中一共展示了PdfPCell.setPaddingRight方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFillCell
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
public PdfPCell getFillCell(){
PdfPCell fillCell = new PdfPCell();
fillCell.setBorderWidth( 0f );
fillCell.setLeft(0);
fillCell.setTop(0);
fillCell.setRight( 0 );
fillCell.setBottom( 0 );
fillCell.setUseAscender( true );
fillCell.setIndent(0);
fillCell.setHorizontalAlignment( Element.ALIGN_LEFT );
fillCell.setVerticalAlignment( Element.ALIGN_BOTTOM );
fillCell.setPaddingLeft( 0f);
fillCell.setPaddingBottom(0f);
fillCell.setPaddingRight(0f );
fillCell.setPaddingTop( 0f );
fillCell.setBorder( 0 );
renderEmptyCell(fillCell);
return fillCell;
}
示例2: createCell
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
public PdfPCell createCell( Block block ){
float[] margins = block.getMargins();
PdfPCell cell = new PdfPCell();
cell.setBorderWidth(0);
cell.setVerticalAlignment( VerticalAlign.getByName(block.getVerticalAlign()).getAlignment() );
cell.setLeft(0);
cell.setTop(0);
cell.setRight(0);
cell.setBottom(0);
cell.setUseAscender( block.isUseAscender() );
cell.setIndent(0);
cell.setPaddingLeft( SizeFactory.millimetersToPostscriptPoints( margins[0]) );
cell.setPaddingBottom( SizeFactory.millimetersToPostscriptPoints(margins[3]) );
cell.setPaddingRight( SizeFactory.millimetersToPostscriptPoints(margins[1]) );
cell.setPaddingTop( SizeFactory.millimetersToPostscriptPoints(margins[2]) );
cell.setFixedHeight(SizeFactory.millimetersToPostscriptPoints( block.getPosition()[3] ));
cell.setBorder(0);
cell.setCellEvent( new CellBlockEvent().createEvent(block));
cell.setRotation( block.getRotation() );
return cell;
}
示例3: getCell
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
/**
* Create a cell with the factory element attributes applied
* @return A cell with the element attributes applied
*/
public PdfPCell getCell() {
PdfPCell lCell = new PdfPCell();
lCell.setUseAscender(false);
lCell.setUseDescender(true);
lCell.getColumn().setAdjustFirstLine(mElementAttributes.getCellAttributes().isAdjustFirstLine());
lCell.setBorder(mElementAttributes.getCellAttributes().getBorder());
lCell.setPaddingTop(mElementAttributes.getCellAttributes().getPaddingTop());
lCell.setPaddingRight(mElementAttributes.getCellAttributes().getPaddingRight());
lCell.setPaddingBottom(mElementAttributes.getCellAttributes().getPaddingBottom());
lCell.setPaddingLeft(mElementAttributes.getCellAttributes().getPaddingLeft());
lCell.setBackgroundColor(mElementAttributes.getCellAttributes().getBackgroundColor());
return lCell;
}
示例4: generateDescription
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
private PdfPCell generateDescription() throws IOException, DocumentException {
PdfPCell cell = new PdfPCell(phrase(data.description, 14));
cell.setHorizontalAlignment(Element.ALIGN_JUSTIFIED);
cell.setBorder(0);
cell.setPaddingTop(10);
cell.setPaddingBottom(15);
cell.setBackgroundColor(backgroundColor);
cell.setPaddingRight(10);
cell.setPaddingLeft(10);
cell.setColspan(12);
return cell;
}
示例5: generateTile
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
public PdfPCell generateTile() throws IOException, DocumentException {
PdfPCell cell = new PdfPCell(PhraseUtil.phrase("- " + pageNumber + " -"));
cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
cell.setVerticalAlignment(Element.ALIGN_CENTER);
cell.setBorder(0);
cell.setPadding(5);
cell.setPaddingRight(10);
cell.setPaddingBottom(9);
cell.setBackgroundColor(backgroundColor);
return cell;
}
示例6: newCell
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
private PdfPCell newCell( String content, int padding ) {
PdfPCell c = new PdfPCell( new Phrase( content ));
c.setHorizontalAlignment( Element.ALIGN_CENTER );
c.setPaddingTop( padding );
c.setPaddingBottom( padding );
c.setPaddingLeft( padding / 2f );
c.setPaddingRight( padding / 2f );
return c;
}
示例7: process
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
@Override
public void process(int level, Node node, InvocationContext context) {
Font font = context.peekFont();
BaseColor color = styles.getColor(Styles.BLOCKQUOTE_COLOR).or(BaseColor.LIGHT_GRAY);
context.pushFont(new FontCopier(font).italic().color(color).get());
List<Element> subs = context.collectChildren(level, node);
context.popFont();
Paragraph p = new Paragraph();
p.addAll(subs);
PdfPCell cell = new PdfPCell();
cell.addElement(p);
cell.setBorder(Rectangle.NO_BORDER);
PdfPCell cellSymbol = new PdfPCell(
new Phrase(context.symbol("quote-left", 24, color))
);
cellSymbol.setVerticalAlignment(Element.ALIGN_TOP);
cellSymbol.setBorder(Rectangle.NO_BORDER);
cellSymbol.setBorderWidthRight(1.0f);
cellSymbol.setBorderColorRight(color);
cellSymbol.setPaddingTop(0f);
cellSymbol.setPaddingBottom(5f);
cellSymbol.setPaddingLeft(10f);
cellSymbol.setPaddingRight(0f);
PdfPTable table = new PdfPTable(new float[]{1, 10});
table.addCell(cellSymbol);
table.addCell(cell);
table.setSpacingBefore(20f);
table.setSpacingAfter(20f);
context.append(table);
}
示例8: process
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
@Override
public void process(int level, Node node, InvocationContext context) {
Attributes attrs = lookupAttributes(context);
List<Element> subs = context.collectChildren(level, node);
Paragraph p = new Paragraph();
p.addAll(subs);
PdfPCell cell = new PdfPCell();
cell.addElement(p);
cell.setBorderColor(BaseColor.LIGHT_GRAY);
cell.setBorder(Rectangle.TOP + Rectangle.BOTTOM);
cell.setPaddingTop(10f);
cell.setPaddingBottom(10f);
Styles styles = context.iTextContext().styles();
BaseColor symbolColor = symbolColor(attrs, styles);
PdfPCell cellSymbol = new PdfPCell(
new Phrase(context.symbol(symbol(attrs), 24, symbolColor))
);
cellSymbol.setVerticalAlignment(Element.ALIGN_TOP);
cellSymbol.setBorderColor(BaseColor.LIGHT_GRAY);
cellSymbol.setBorder(Rectangle.TOP + Rectangle.BOTTOM);
cellSymbol.setPaddingTop(10f);
cellSymbol.setPaddingBottom(10f);
cellSymbol.setPaddingLeft(0f);
cellSymbol.setPaddingRight(10f);
PdfPTable table = new PdfPTable(new float[]{1, 10});
table.addCell(cellSymbol);
table.addCell(cell);
table.setSpacingBefore(20f);
table.setSpacingAfter(20f);
ITextUtils.applyAttributes(table, attrs);
context.append(table);
}
示例9: setStyleRodape
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
private void setStyleRodape(PdfPCell cellRodape) {
cellRodape.setBorderWidthBottom(0.5f);
cellRodape.setPadding(2f);
cellRodape.setPaddingLeft(0.8f);
cellRodape.setPaddingRight(0.8f);
}
示例10: onRender
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
@Override
public void onRender( PdfPCell cell ) throws PdfRenderException{
PdfPTable table = new PdfPTable( widths.length );
try{
table.setTotalWidth( getTotalWidthsAsPs() );
table.setLockedWidth( true );
table.setSpacingAfter( 0f );
for( AbstractParagraph tableCell : cells ){
PdfPCell c = new PdfPCell();
float[] padding = new float[]{0f,0f,0f,0f};
if( tableCell instanceof TableCell ){
padding = ((TableCell) tableCell).getPadding();
}
c.setBorderWidth( 0f );
c.setLeft(0);
c.setTop(0);
c.setRight( 0 );
c.setBottom( 0 );
c.setUseAscender( true );
c.setIndent(0);
c.setHorizontalAlignment( Element.ALIGN_LEFT );
c.setVerticalAlignment( Element.ALIGN_TOP );
c.setPaddingLeft( SizeFactory.millimetersToPostscriptPoints(padding[0]));
c.setPaddingBottom( SizeFactory.millimetersToPostscriptPoints(padding[3]) );
c.setPaddingRight( SizeFactory.millimetersToPostscriptPoints(padding[2]) );
c.setPaddingTop(SizeFactory.millimetersToPostscriptPoints(padding[1]));
c.setBorder( 0 );
tableCell.onRender( c );
table.addCell( c );
}
cell.addElement( table );
}catch( Exception e ){
throw new PdfRenderException(e);
}
}
示例11: generateHeaderData
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
private PdfPCell generateHeaderData() throws IOException, DocumentException, URISyntaxException {
String textMountain = MessageFormat.format("{0}", data.mountains);
PdfPCell cellMountain = new PdfPCell(PhraseUtil.phrase(textMountain, 12));
cellMountain.setBorder(0);
cellMountain.setHorizontalAlignment(Element.ALIGN_RIGHT);
cellMountain.setVerticalAlignment(Element.ALIGN_CENTER);
cellMountain.setPadding(0);
cellMountain.setPaddingBottom(4);
PdfPCell cellMountainIcon = new PdfPCell(ImageUtils.readImageFromResources("icons/mountains01.png"), true);
cellMountainIcon.setBorder(0);
cellMountainIcon.setHorizontalAlignment(Element.ALIGN_RIGHT);
cellMountainIcon.setFixedHeight(10);
String heightMountain = MessageFormat.format("{0}m n.p.m., {1}km", data.height, data.distanceFromCracow);
PdfPCell cellHeight = new PdfPCell(PhraseUtil.phrase(heightMountain, 12));
cellHeight.setBorder(0);
cellHeight.setHorizontalAlignment(Element.ALIGN_RIGHT);
cellHeight.setVerticalAlignment(Element.ALIGN_CENTER);
cellHeight.setPadding(0);
cellHeight.setPaddingBottom(4);
PdfPCell cellHeightIcon = new PdfPCell(ImageUtils.readImageFromResources("icons/map01.png"), true);
cellHeightIcon.setBorder(0);
cellHeightIcon.setHorizontalAlignment(Element.ALIGN_RIGHT);
cellHeightIcon.setFixedHeight(10);
String coordinatesMountain = MessageFormat.format("{0}, {1}", data.latitude, data.longitude);
PdfPCell cellCoordinates = new PdfPCell(PhraseUtil.phrase(coordinatesMountain, 12));
cellCoordinates.setBorder(0);
cellCoordinates.setHorizontalAlignment(Element.ALIGN_RIGHT);
cellCoordinates.setVerticalAlignment(Element.ALIGN_CENTER);
cellCoordinates.setPadding(0);
cellCoordinates.setPaddingBottom(4);
PdfPCell cellCoordinatesIcon = new PdfPCell(ImageUtils.readImageFromResources("icons/compas.png"), true);
cellCoordinatesIcon.setBorder(0);
cellCoordinatesIcon.setHorizontalAlignment(Element.ALIGN_RIGHT);
cellCoordinatesIcon.setFixedHeight(10);
PdfPTable headerTable = new PdfPTable(2);
headerTable.setWidths(new float[] {10, 1});
headerTable.addCell(cellMountain);
headerTable.addCell(cellMountainIcon);
headerTable.addCell(cellHeight);
headerTable.addCell(cellHeightIcon);
headerTable.addCell(cellCoordinates);
headerTable.addCell(cellCoordinatesIcon);
PdfPCell cell = new PdfPCell(headerTable);
cell.setBorder(0);
cell.setPaddingTop(10);
cell.setPaddingBottom(10);
cell.setPaddingRight(10);
cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
cell.setVerticalAlignment(Element.ALIGN_CENTER);
cell.setColspan(5);
cell.setBackgroundColor(backgroundColor);
return cell;
}