本文整理汇总了Java中com.itextpdf.text.pdf.PdfPCell.setPaddingLeft方法的典型用法代码示例。如果您正苦于以下问题:Java PdfPCell.setPaddingLeft方法的具体用法?Java PdfPCell.setPaddingLeft怎么用?Java PdfPCell.setPaddingLeft使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.itextpdf.text.pdf.PdfPCell
的用法示例。
在下文中一共展示了PdfPCell.setPaddingLeft方法的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: generateMapImage
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
private PdfPCell generateMapImage() throws IOException, DocumentException {
PdfPCell cell = new PdfPCell(imageMap(data.mapUrl), true);
cell.setBorder(0);
cell.setPaddingTop(10);
cell.setPaddingBottom(10);
cell.setPaddingLeft(5);
cell.setColspan(6);
return cell;
}
示例4: 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;
}
示例5: generateTableOfContentsValue
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
private PdfPCell generateTableOfContentsValue(String value) throws IOException, DocumentException {
PdfPCell cell = new PdfPCell(PhraseUtil.phrase(value, 12, Font.BOLD));
cell.setBorder(0);
cell.setHorizontalAlignment(Element.ALIGN_LEFT);
cell.setPaddingBottom(3);
cell.setPaddingLeft(10);
cell.setColspan(3);
return cell;
}
示例6: generateTitleCell
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
private PdfPCell generateTitleCell() throws IOException, DocumentException {
//PdfPCell cell = new PdfPCell(PhraseUtil.phrase("Kolekcjoner pieczątek", 25, Font.BOLD));
PdfPCell cell = new PdfPCell(PhraseUtil.phrase(" ", 25, Font.BOLD));
cell.setBorder(0);
cell.setPaddingTop(130);
cell.setPaddingBottom(20);
cell.setPaddingLeft(20);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_CENTER);
cell.setBackgroundColor(BackgroundColorGenerator.DEFAULT_BACKGROUND_COLOR);
return cell;
}
示例7: generateHeaderTitle
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
private PdfPCell generateHeaderTitle() throws IOException, DocumentException {
PdfPCell cell = new PdfPCell(phrase(data.title, 15, Font.BOLD));
cell.setBorder(0);
cell.setPaddingTop(10);
cell.setPaddingBottom(10);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(7);
cell.setBackgroundColor(backgroundColor);
cell.setPaddingLeft(10);
return cell;
}
示例8: 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;
}
示例9: generateStamp
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
private PdfPCell generateStamp() throws IOException, DocumentException, URISyntaxException {
PdfPTable stampTable = new PdfPTable(2);
stampTable.setWidths(new float[] {1,12});
PdfPCell cellIcon = new PdfPCell(ImageUtils.readImageFromResources("icons/check.png"));
cellIcon.setFixedHeight(10);
cellIcon.setPadding(2);
cellIcon.setBorder(0);
cellIcon.setBackgroundColor(backgroundColor);
PdfPCell cellText = new PdfPCell(phrase("Data i pieczątka"));
cellText.setHorizontalAlignment(Element.ALIGN_LEFT);
cellText.setVerticalAlignment(Element.ALIGN_CENTER);
cellText.setBorder(0);
cellText.setBackgroundColor(backgroundColor);
cellText.setPadding(0);
cellText.setPaddingTop(5);
cellText.setPaddingLeft(5);
stampTable.addCell(cellIcon);
stampTable.addCell(cellText);
PdfPCell stampCell = new PdfPCell(stampTable);
stampCell.setPadding(0);
stampCell.setBorder(0);
return stampCell;
}
示例10: 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;
}
示例11: 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);
}
示例12: 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);
}
示例13: 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);
}
示例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: GeneratePDF
import com.itextpdf.text.pdf.PdfPCell; //导入方法依赖的package包/类
public void GeneratePDF()
{
Document document = new Document();
try
{
PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("/sdcard/TutorialesHackro/hoja.pdf"));
document.open();
PdfPTable table = new PdfPTable(3); // 3 columns.
table.setWidthPercentage(100); //Width 100%
table.setSpacingBefore(10f); //Space before table
table.setSpacingAfter(10f); //Space after table
//Set Column widths
float[] columnWidths = {1f, 1f, 1f};
table.setWidths(columnWidths);
PdfPCell cell1 = new PdfPCell(new Paragraph("Cell 1"));
cell1.setBorderColor(BaseColor.BLUE);
cell1.setPaddingLeft(10);
cell1.setHorizontalAlignment(Element.ALIGN_CENTER);
cell1.setVerticalAlignment(Element.ALIGN_MIDDLE);
PdfPCell cell2 = new PdfPCell(new Paragraph("Cell 2"));
cell2.setBorderColor(BaseColor.GREEN);
cell2.setPaddingLeft(10);
cell2.setHorizontalAlignment(Element.ALIGN_CENTER);
cell2.setVerticalAlignment(Element.ALIGN_MIDDLE);
PdfPCell cell3 = new PdfPCell(new Paragraph("Cell 3"));
cell3.setBorderColor(BaseColor.RED);
cell3.setPaddingLeft(10);
cell3.setHorizontalAlignment(Element.ALIGN_CENTER);
cell3.setVerticalAlignment(Element.ALIGN_MIDDLE);
//To avoid having the cell border and the content overlap, if you are having thick cell borders
//cell1.setUserBorderPadding(true);
//cell2.setUserBorderPadding(true);
//cell3.setUserBorderPadding(true);
table.addCell(cell1);
table.addCell(cell2);
table.addCell(cell3);
document.add(table);
createDirectoryAndSaveFile(writer, "david");
document.close();
writer.close();
} catch (Exception e)
{
e.printStackTrace();
Log.e("ewdfhyfafedyatfawytedfytew b",e.getMessage());
}
}