本文整理汇总了Java中com.itextpdf.text.pdf.PdfPCell.setBorderWidth方法的典型用法代码示例。如果您正苦于以下问题:Java PdfPCell.setBorderWidth方法的具体用法?Java PdfPCell.setBorderWidth怎么用?Java PdfPCell.setBorderWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.itextpdf.text.pdf.PdfPCell
的用法示例。
在下文中一共展示了PdfPCell.setBorderWidth方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: buildHeaderNameLine
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
public static PdfPTable buildHeaderNameLine(String schuelername, Font headerFont) throws DocumentException {
PdfPCell labelCell = new PdfPCell(new Phrase("Name", headerFont));
labelCell.setBorder(Rectangle.BOTTOM);
labelCell.setBorderWidth(1f);
PdfPCell nameCell = new PdfPCell(new Phrase(schuelername, headerFont));
nameCell.setBorder(Rectangle.BOTTOM);
nameCell.setBorderWidth(1f);
nameCell.setColspan(5);
PdfPTable table = prebuildHeaderTable();
table.addCell(labelCell);
table.addCell(nameCell);
return table;
}
示例4: buildFooterVersetzungsvermerkLine
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
public static PdfPTable buildFooterVersetzungsvermerkLine(String versetzungsvermerk, Font footerFont) throws DocumentException {
PdfPCell labelCell = new PdfPCell(new Phrase("Versetzungsvermerk", footerFont));
labelCell.setBorder(Rectangle.BOTTOM);
labelCell.setBorderWidth(1f);
PdfPCell nameCell = new PdfPCell(new Phrase(versetzungsvermerk, footerFont));
nameCell.setBorder(Rectangle.BOTTOM);
nameCell.setBorderWidth(1f);
PdfPTable table = new PdfPTable(2);
table.setHorizontalAlignment(Element.ALIGN_LEFT);
table.setWidthPercentage(100f);
table.addCell(labelCell);
table.addCell(nameCell);
table.setWidths(new float[] {0.3f, 0.7f});
return table;
}
示例5: buildFooterDatumLine
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
public static PdfPTable buildFooterDatumLine(String datumString, Font footerFont) throws DocumentException {
PdfPCell labelCell = new PdfPCell(new Phrase("Datum", footerFont));
labelCell.setBorder(Rectangle.BOTTOM);
labelCell.setBorderWidth(1f);
PdfPCell nameCell = new PdfPCell(new Phrase(datumString, footerFont));
nameCell.setBorder(Rectangle.BOTTOM);
nameCell.setBorderWidth(1f);
PdfPTable table = new PdfPTable(2);
table.setHorizontalAlignment(Element.ALIGN_LEFT);
table.setWidthPercentage(100f);
table.addCell(labelCell);
table.addCell(nameCell);
table.setWidths(new float[] {0.3f, 0.7f});
return table;
}
示例6: buildFooterDienstsiegelLine
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
public static PdfPTable buildFooterDienstsiegelLine(Font footerFont) throws DocumentException {
PdfPCell leftCell = new PdfPCell(new Phrase("", footerFont));
leftCell.setBorder(Rectangle.NO_BORDER);
leftCell.setBorderWidth(1f);
PdfPCell centerCell = new PdfPCell(new Phrase("Dienstsiegel der Schule", footerFont));
centerCell.setBorder(Rectangle.NO_BORDER);
centerCell.setBorderWidth(1f);
centerCell.setHorizontalAlignment(Element.ALIGN_CENTER);
PdfPCell rightCell = new PdfPCell(new Phrase("", footerFont));
rightCell.setBorder(Rectangle.NO_BORDER);
rightCell.setBorderWidth(1f);
PdfPTable table = new PdfPTable(3);
table.setHorizontalAlignment(Element.ALIGN_MIDDLE);
table.setWidthPercentage(100f);
table.addCell(leftCell);
table.addCell(centerCell);
table.addCell(rightCell);
table.setWidths(new float[] {0.3f, 0.3f, 0.3f});
return table;
}
示例7: buildFooterUnterschriftenLine
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
public static PdfPTable buildFooterUnterschriftenLine(Font footerFont) throws DocumentException {
PdfPCell leftCell = new PdfPCell(new Phrase("Schulleiter(in)", footerFont));
leftCell.setBorder(Rectangle.TOP);
leftCell.setBorderWidth(1f);
leftCell.setHorizontalAlignment(Element.ALIGN_CENTER);
PdfPCell centerCell = new PdfPCell(new Phrase("", footerFont));
centerCell.setBorder(Rectangle.TOP);
centerCell.setBorderWidth(1f);
centerCell.setHorizontalAlignment(Element.ALIGN_CENTER);
PdfPCell rightCell = new PdfPCell(new Phrase("Klassenleiter(in)", footerFont));
rightCell.setBorder(Rectangle.TOP);
rightCell.setBorderWidth(1f);
rightCell.setHorizontalAlignment(Element.ALIGN_CENTER);
PdfPTable table = new PdfPTable(3);
table.setWidthPercentage(100f);
table.addCell(leftCell);
table.addCell(centerCell);
table.addCell(rightCell);
table.setWidths(new float[] {0.3f, 0.3f, 0.3f});
return table;
}
示例8: buildFooterHalbjahrDatumKlassenleiterLine
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
public static PdfPTable buildFooterHalbjahrDatumKlassenleiterLine(Font footerFont) throws DocumentException {
PdfPCell leftCell = new PdfPCell(new Phrase("Datum", footerFont));
leftCell.setBorder(Rectangle.TOP);
leftCell.setBorderWidth(1f);
leftCell.setHorizontalAlignment(Element.ALIGN_CENTER);
PdfPCell centerCell = new PdfPCell(new Phrase("", footerFont));
centerCell.setBorder(Rectangle.TOP);
centerCell.setBorderWidth(1f);
centerCell.setHorizontalAlignment(Element.ALIGN_CENTER);
PdfPCell rightCell = new PdfPCell(new Phrase("Klassenleiter(in)", footerFont));
rightCell.setBorder(Rectangle.TOP);
rightCell.setBorderWidth(1f);
rightCell.setHorizontalAlignment(Element.ALIGN_CENTER);
PdfPTable table = new PdfPTable(3);
table.setWidthPercentage(100f);
table.addCell(leftCell);
table.addCell(centerCell);
table.addCell(rightCell);
table.setWidths(new float[] {0.3f, 0.3f, 0.3f});
return table;
}
示例9: HeadTablePrincipal
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
public PdfPTable HeadTablePrincipal() {
PdfPTable pTableDate= new PdfPTable(new float[]{9.7f,28.8f,14.7f,10.7f,10.7f,10.7f,14.7f});
pTableDate.setWidthPercentage(95);
for (int i = 0; i < 7; i++)
{
PdfPCell cellDados= new PdfPCell(funcaoTitulo(i));
cellDados.setHorizontalAlignment(a);
cellDados.setBorderWidth(0.85f);
pTableDate.addCell(cellDados);
}
return pTableDate;
}
示例10: createInstructionCell
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
private PdfPCell createInstructionCell() {
PdfPCell instructionCell = new PdfPCell();
instructionCell.setHorizontalAlignment(Element.ALIGN_LEFT);
instructionCell.setBorder(Rectangle.BOTTOM);
instructionCell.setBorderWidth(1f);
instructionCell.setBorderColor(BaseColor.WHITE);
instructionCell.setPaddingBottom(10f);
return instructionCell;
}
示例11: buildHeaderKlassendatenLine
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
public static PdfPTable buildHeaderKlassendatenLine(LebData lebData, Font headerFont) throws DocumentException {
PdfPCell leftLabelCell = new PdfPCell(new Phrase("Klasse", headerFont));
leftLabelCell.setBorder(Rectangle.BOTTOM);
leftLabelCell.setBorderWidth(1f);
PdfPCell leftValueCell = new PdfPCell(new Phrase(lebData.getKlassenname(), headerFont));
leftValueCell.setBorder(Rectangle.BOTTOM);
leftValueCell.setBorderWidth(1f);
PdfPCell centerLabelCell = new PdfPCell(new Phrase("Schuljahr", headerFont));
centerLabelCell.setBorder(Rectangle.BOTTOM);
centerLabelCell.setBorderWidth(1f);
PdfPCell centerValueCell = new PdfPCell(new Phrase(lebData.getSchuljahr(), headerFont));
centerValueCell.setBorder(Rectangle.BOTTOM);
centerValueCell.setBorderWidth(1f);
PdfPCell rightLabelCell = new PdfPCell(new Phrase("Schulhalbjahr", headerFont));
rightLabelCell.setBorder(Rectangle.BOTTOM);
rightLabelCell.setBorderWidth(1f);
PdfPCell rightValueCell = new PdfPCell(new Phrase(lebData.getSchulhalbjahr().getId().toString(), headerFont));
rightValueCell.setBorder(Rectangle.BOTTOM);
rightValueCell.setBorderWidth(1f);
PdfPTable table = prebuildHeaderTable();
table.addCell(leftLabelCell);
table.addCell(leftValueCell);
table.addCell(centerLabelCell);
table.addCell(centerValueCell);
table.addCell(rightLabelCell);
table.addCell(rightValueCell);
return table;
}
示例12: buildFooterKenntnisLine
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
public static PdfPTable buildFooterKenntnisLine(Font footerFont) {
PdfPCell cell = new PdfPCell(new Phrase("Kenntnis genommen: Erziehungsberechtigte", footerFont));
cell.setBorder(Rectangle.TOP);
cell.setBorderWidth(1f);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
PdfPTable table = new PdfPTable(1);
table.setHorizontalAlignment(Element.ALIGN_CENTER);
table.setWidthPercentage(100f);
table.addCell(cell);
return table;
}
示例13: addTotalRow
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
/**
* Adds a total row to the table.
*
* @param table
* the table.
* @param contents
* the columns contents.
* @param font
* the font to use.
* @param borderTop
* the border top width.
* @param borderBottom
* the border bottom width.
*/
private static void addTotalRow(PdfPTable table, Object[] contents, Font font, float borderTop,
float borderBottom) {
PdfPCell labelCell = ReportServiceHelper.createTableCell(contents[0], font, null,
ReportServiceHelper.PDF_ALIGN_RIGHT, null, 2);
labelCell.setBorderWidth(0);
labelCell.setBorderWidthTop(borderTop);
labelCell.setBorderWidthBottom(borderBottom);
table.addCell(labelCell);
PdfPCell numberCell = ReportServiceHelper.createTableCell(contents[1], font, null,
ReportServiceHelper.PDF_ALIGN_RIGHT, null, 1);
numberCell.setBorderWidth(0);
numberCell.setBorderWidthTop(borderTop);
numberCell.setBorderWidthBottom(borderBottom);
table.addCell(numberCell);
PdfPCell totalCell = ReportServiceHelper.createTableCell(contents.length == 3 ? contents[2] : null, font, null,
ReportServiceHelper.PDF_ALIGN_RIGHT, null, 1);
totalCell.setBorderWidth(0);
totalCell.setBorderWidthTop(borderTop);
totalCell.setBorderWidthBottom(borderBottom);
table.addCell(totalCell);
PdfPCell emptyCell = ReportServiceHelper.createEmptyPdfCell(1, null);
emptyCell.setBorderWidth(0);
emptyCell.setBorderWidthTop(borderTop);
emptyCell.setBorderWidthBottom(borderBottom);
table.addCell(emptyCell);
}
开发者ID:NASA-Tournament-Lab,项目名称:CoECI-OPM-Service-Credit-Redeposit-Deposit-Application,代码行数:44,代码来源:BalancedScorecardPaymentReportService.java
示例14: 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);
}
}
示例15: createBlueBlock
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
private void createBlueBlock(PdfContentByte cb, int treeCount) throws DocumentException {
cb.saveState();
cb.setRGBColorFill(0x64, 0xA7, 0xBD);
cb.rectangle(0.0f, 375.0f, 595.0f, 200.0f);
cb.fill();
cb.stroke();
cb.restoreState();
Font textFont = new Font(FontFamily.TIMES_ROMAN, 14, Font.ITALIC, BaseColor.WHITE);
Font textBlack = new Font(FontFamily.TIMES_ROMAN, 14, Font.ITALIC, BaseColor.BLACK);
Font textFontTreeCount = new Font(FontFamily.HELVETICA, 30, Font.BOLD, BaseColor.BLACK);
PdfPTable tableForTreeCount = new PdfPTable(1);
float[] rows = { 495f };
tableForTreeCount.setTotalWidth(rows);
tableForTreeCount.getDefaultCell().setBorder(Rectangle.NO_BORDER);
tableForTreeCount.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE);
tableForTreeCount.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
tableForTreeCount.getDefaultCell().setFixedHeight(40);
Integer treeCountAsObject = treeCount;
tableForTreeCount.addCell(new Phrase(new Chunk(treeCountAsObject.toString(), textFontTreeCount)));
tableForTreeCount.writeSelectedRows(0, 1, 50f, 575f, cb);
PdfPTable tableForWhiteText = new PdfPTable(1);
tableForWhiteText.setTotalWidth(rows);
tableForWhiteText.getDefaultCell().setBorder(Rectangle.BOTTOM);
tableForWhiteText.getDefaultCell().setBorderWidth(1f);
tableForWhiteText.getDefaultCell().setBorderColor(BaseColor.WHITE);
tableForWhiteText.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE);
tableForWhiteText.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
tableForWhiteText.getDefaultCell().setFixedHeight(40);
Phrase phraseForTreesPlantForYou = new Phrase();
if (treeCount == 1) {
phraseForTreesPlantForYou.add(new Chunk("Baum wurde für Sie gepflanzt!", textFont));
} else {
phraseForTreesPlantForYou.add(new Chunk("Bäume wurden für Sie gepflanzt!", textFont));
}
PdfPCell longTextCell = new PdfPCell();
longTextCell.setHorizontalAlignment(Element.ALIGN_LEFT);
longTextCell.setVerticalAlignment(Element.ALIGN_MIDDLE);
longTextCell.setBorder(Rectangle.BOTTOM);
longTextCell.setBorderWidth(1f);
longTextCell.setBorderColor(BaseColor.WHITE);
longTextCell.setFixedHeight(65);
Paragraph longText = new Paragraph(new Chunk(
"Mit diesem Gutschein können sie Ihre Pflanzung in Augenschein nehmen und mehr über die naturnahen Aufforstungsprojekte bei \"I Plant A Tree\" erfahren. Ihre Bäume wachsen auf ehemals brachliegenden Flächen und sind Teil neu entstehender Wälder.",
textFont));
longText.setLeading(15f);
longTextCell.addElement(longText);
tableForWhiteText.addCell(phraseForTreesPlantForYou);
tableForWhiteText.addCell(longTextCell);
tableForWhiteText.writeSelectedRows(0, 2, 50f, 535f, cb);
PdfPTable tableForHowItWorks = new PdfPTable(1);
tableForHowItWorks.setTotalWidth(rows);
tableForHowItWorks.getDefaultCell().setBorder(Rectangle.NO_BORDER);
tableForHowItWorks.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE);
tableForHowItWorks.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
tableForHowItWorks.getDefaultCell().setFixedHeight(40);
tableForHowItWorks.addCell(new Phrase(new Chunk("Und so einfach funktioniert's:", textBlack)));
tableForHowItWorks.writeSelectedRows(0, 2, 50f, 425f, cb);
}