當前位置: 首頁>>代碼示例>>Java>>正文


Java PdfPTable.setSpacingAfter方法代碼示例

本文整理匯總了Java中com.itextpdf.text.pdf.PdfPTable.setSpacingAfter方法的典型用法代碼示例。如果您正苦於以下問題:Java PdfPTable.setSpacingAfter方法的具體用法?Java PdfPTable.setSpacingAfter怎麽用?Java PdfPTable.setSpacingAfter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.itextpdf.text.pdf.PdfPTable的用法示例。


在下文中一共展示了PdfPTable.setSpacingAfter方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: process

import com.itextpdf.text.pdf.PdfPTable; //導入方法依賴的package包/類
@Override
public void process(int level, Node node, InvocationContext context) {

    TableNode tableNode = (TableNode) node;
    List<TableColumnNode> tableNodeColumns = tableNode.getColumns();

    PdfPTable table = new PdfPTable(tableNodeColumns.size());
    for (PdfPTableEvent tableEvent : tableEvents) {
        table.setTableEvent(tableEvent);
    }
    context.pushTable(new TableInfos(table, tableNodeColumns));
    context.processChildren(level, node);
    context.popTable();


    KeyValues kvs = context.iTextContext().keyValues();

    Float spacingBefore = kvs.<Float>getNullable(TABLE_SPACING_BEFORE).or(5f);
    Float spacingAfter = kvs.<Float>getNullable(TABLE_SPACING_AFTER).or(5f);
    table.setSpacingBefore(spacingBefore);
    table.setSpacingAfter(spacingAfter);

    applyAttributes(context, table);
    context.append(table);
}
 
開發者ID:Arnauld,項目名稱:gutenberg,代碼行數:26,代碼來源:TableNodeProcessor.java

示例2: addOfferInstances

import com.itextpdf.text.pdf.PdfPTable; //導入方法依賴的package包/類
private void addOfferInstances(List<OfferInstance> offerInstances, Document document, BaseFont bf)
		throws DocumentException {

	if(offerInstances.isEmpty()) {
		return;
	}

	document.add(new Paragraph("Wybrane oferty: ", new Font(bf, 12)));

	PdfPTable offerInstancesTable = new PdfPTable(3);
	offerInstancesTable.setWidthPercentage(100);
	offerInstancesTable.setSpacingBefore(18f);
	offerInstancesTable.setSpacingAfter(18f);
	createofferInstancesTableHeaders(offerInstancesTable);
	createofferInstancesTableContent(offerInstances, offerInstancesTable);
	document.add(offerInstancesTable);
}
 
開發者ID:marcin-pwr,項目名稱:hotel,代碼行數:18,代碼來源:ResidenceService.java

示例3: getTable

import com.itextpdf.text.pdf.PdfPTable; //導入方法依賴的package包/類
/**
 * Create a table with the factory element attributes applied
 * @return A table with the element attributes applied
 */
public PdfPTable getTable(int pColumns) {
  PdfPTable lTable = new PdfPTable(pColumns);
  // Set split late to false so that tables will be split immediately if they don't fit on a page instead of moving
  // them to the next page then attempting to split if they don't fit there. iText gets in an infinite loop with the
  // latter option when content in nested table rows can't split (see EDU-3490 on JIRA).
  lTable.setSplitLate(false);
  mElementAttributes.getTableAttributes().getWidthPercentage().ifPresent(pWidthPercentage -> {
    lTable.setWidthPercentage(pWidthPercentage);
    lTable.setLockedWidth(false);
  });
  mElementAttributes.getTableAttributes().getFixedWidth().ifPresent(pFixedWidth -> {
    lTable.setTotalWidth(pFixedWidth);
    lTable.setLockedWidth(true);
  });
  lTable.setHorizontalAlignment(mElementAttributes.getTableAttributes().getHorizontalAlignment());
  lTable.setSpacingBefore(mElementAttributes.getTableAttributes().getSpacingBefore());
  lTable.setSpacingAfter(mElementAttributes.getTableAttributes().getSpacingAfter());
  lTable.setKeepTogether(mElementAttributes.getTableAttributes().isKeepTogether());

  return lTable;
}
 
開發者ID:Fivium,項目名稱:FOXopen,代碼行數:26,代碼來源:ElementFactory.java

示例4: createBarcodeTable

import com.itextpdf.text.pdf.PdfPTable; //導入方法依賴的package包/類
private PdfPTable createBarcodeTable(PdfContentByte cb, String caption, String detail, String code) {
	// Barcode Generation
	Barcode39 codeEAN = new Barcode39();
	codeEAN.setCode(code);
	Image imageEAN = codeEAN.createImageWithBarcode(cb, null, null);
	
	// Table
	PdfPTable table = new PdfPTable(1);
	table.setSpacingBefore(10);
	table.setSpacingAfter(10);
	table.setTotalWidth(80);
       table.setLockedWidth(true);
       PdfPCell cell1 = new PdfPCell(imageEAN);
       PdfPCell cell2 = new PdfPCell(new Paragraph(caption));
       PdfPCell cell3 = new PdfPCell(new Paragraph(detail));
       cell1.setBorder(Rectangle.NO_BORDER);
       cell2.setBorder(Rectangle.NO_BORDER);
       cell3.setBorder(Rectangle.NO_BORDER);
       table.addCell(cell1);
       table.addCell(cell2);
       table.addCell(cell3);
       
       return table;
}
 
開發者ID:noproblan,項目名稱:npl-cash,代碼行數:25,代碼來源:ArticleBarcodePdfGenerator.java

示例5: createBlankTable

import com.itextpdf.text.pdf.PdfPTable; //導入方法依賴的package包/類
public PdfPTable createBlankTable() {
    PdfPTable table = new PdfPTable(1);
    table.getDefaultCell().setBorder(0);
    table.addCell(createCell("", keyfont));
    table.setSpacingAfter(20.0f);
    table.setSpacingBefore(20.0f);
    return table;
}
 
開發者ID:melonlee,項目名稱:PowerApi,代碼行數:9,代碼來源:PDFTest.java

示例6: createTable

import com.itextpdf.text.pdf.PdfPTable; //導入方法依賴的package包/類
public PdfPTable createTable( float widthInPs ){
	PdfPTable table = new PdfPTable(1);
	table.setTotalWidth(widthInPs);
	table.setLockedWidth( true );
	table.setSpacingBefore(0);
	table.setSpacingAfter(0);
	return table;
}
 
開發者ID:Billes,項目名稱:pdf-renderer,代碼行數:9,代碼來源:TableFactory.java

示例7: addAccomodations

import com.itextpdf.text.pdf.PdfPTable; //導入方法依賴的package包/類
private void addAccomodations(List<Accomodation> accomodations, Document document, BaseFont bf)
		throws DocumentException {

	document.add(new Paragraph("Zarezerwowane pokoje: ", new Font(bf, 12)));

	PdfPTable accomodationsTable = new PdfPTable(7);
	accomodationsTable.setWidthPercentage(100);
	accomodationsTable.setSpacingBefore(18f);
	accomodationsTable.setSpacingAfter(18f);
	createAccomodationTableHeaders(accomodationsTable);
	createAccomodationTableContent(accomodations, accomodationsTable);
	document.add(accomodationsTable);
}
 
開發者ID:marcin-pwr,項目名稱:hotel,代碼行數:14,代碼來源:ResidenceService.java

示例8: getAuthorizedRecipients

import com.itextpdf.text.pdf.PdfPTable; //導入方法依賴的package包/類
private PdfPTable getAuthorizedRecipients() {
	PdfPTable table = new PdfPTable(1);
	table.setSpacingAfter(1.0F);
	table.setSpacingBefore(1.0F);
	table.getDefaultCell().setBackgroundColor(BaseColor.CYAN);
	table.setWidthPercentage(40.0F);
	table.addCell("Authorized Recipient(s)");
	table.getDefaultCell().setBackgroundColor(BaseColor.WHITE);
	Iterator iter = PDFBuilderForCDA.this.recipients.iterator();
	while (iter.hasNext()) {
		String r = (String) iter.next();
		table.addCell(r);
	}
	return table;
}
 
開發者ID:tlin-fei,項目名稱:ds4p,代碼行數:16,代碼來源:PDFBuilderForCDA.java

示例9: getMaskingActions

import com.itextpdf.text.pdf.PdfPTable; //導入方法依賴的package包/類
private PdfPTable getMaskingActions() {
	PdfPTable table = new PdfPTable(1);
	table.setSpacingAfter(1.0F);
	table.setSpacingBefore(1.0F);
	table.getDefaultCell().setBackgroundColor(BaseColor.CYAN);
	table.setWidthPercentage(40.0F);
	table.addCell("Data Sensitivities Requiring Masking(Encryption)");
	table.getDefaultCell().setBackgroundColor(BaseColor.WHITE);
	Iterator iter = PDFBuilderForCDA.this.mask.iterator();
	while (iter.hasNext()) {
		String r = (String) iter.next();
		table.addCell(r);
	}
	return table;
}
 
開發者ID:tlin-fei,項目名稱:ds4p,代碼行數:16,代碼來源:PDFBuilderForCDA.java

示例10: getRedactActions

import com.itextpdf.text.pdf.PdfPTable; //導入方法依賴的package包/類
private PdfPTable getRedactActions() {
	PdfPTable table = new PdfPTable(1);
	table.setSpacingAfter(1.0F);
	table.setSpacingBefore(1.0F);
	table.getDefaultCell().setBackgroundColor(BaseColor.CYAN);
	table.setWidthPercentage(40.0F);
	table.addCell("Data Sensitivities Requiring Redaction(Removal From Record)");
	table.getDefaultCell().setBackgroundColor(BaseColor.WHITE);
	Iterator iter = PDFBuilderForCDA.this.redact.iterator();
	while (iter.hasNext()) {
		String r = (String) iter.next();
		table.addCell(r);
	}
	return table;
}
 
開發者ID:tlin-fei,項目名稱:ds4p,代碼行數:16,代碼來源:PDFBuilderForCDA.java

示例11: getAllowedPOUs

import com.itextpdf.text.pdf.PdfPTable; //導入方法依賴的package包/類
private PdfPTable getAllowedPOUs() {
	PdfPTable table = new PdfPTable(1);
	table.setSpacingAfter(1.0F);
	table.setSpacingBefore(1.0F);
	table.getDefaultCell().setBackgroundColor(BaseColor.CYAN);
	table.setWidthPercentage(40.0F);
	table.addCell("Intended Purpose(s) of Use");
	table.getDefaultCell().setBackgroundColor(BaseColor.WHITE);
	Iterator iter = PDFBuilderForCDA.this.pous.iterator();
	while (iter.hasNext()) {
		String r = (String) iter.next();
		table.addCell(r);
	}
	return table;
}
 
開發者ID:tlin-fei,項目名稱:ds4p,代碼行數:16,代碼來源:PDFBuilderForCDA.java

示例12: process

import com.itextpdf.text.pdf.PdfPTable; //導入方法依賴的package包/類
public List<Element> process(SourceCode sourceCode) {
    String lang = sourceCode.lang();
    String content = sourceCode.content();
    boolean linenos = sourceCode.showLineNumbers();

    Tokens tokens = pygments.tokenize(lang, content);
    Paragraph p = new Paragraph();
    for (TokenWithValue token : tokens) {
        Style style = styleSheet.styleOf(token.token);

        BaseColor color = toColor(style.fg());
        int s = calculateStyle(style);

        Font font = styles.getFont(Styles.CODE_FONT, s, color).get();
        Chunk o = new Chunk(token.value, font);

        RGB bg = style.bg();
        if (bg != null)
            o.setBackground(toColor(bg));
        p.add(o);
    }

    PdfPCell cell = new PdfPCell(p);
    cell.setPaddingBottom(5.0f);
    cell.setBorder(Rectangle.NO_BORDER);

    PdfPTable table = new PdfPTable(1);
    table.addCell(cell);
    table.setSpacingBefore(5.0f);
    table.setSpacingAfter(5.0f);
    table.setTableEvent(new TableBackground(toColor(styleSheet.backgroundColor())));
    return Arrays.<Element>asList(table);
}
 
開發者ID:Arnauld,項目名稱:gutenberg,代碼行數:34,代碼來源:PygmentsAdapter.java

示例13: process

import com.itextpdf.text.pdf.PdfPTable; //導入方法依賴的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);
}
 
開發者ID:Arnauld,項目名稱:gutenberg,代碼行數:38,代碼來源:BlockQuoteNodeProcessor.java

示例14: process

import com.itextpdf.text.pdf.PdfPTable; //導入方法依賴的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);

}
 
開發者ID:Arnauld,項目名稱:gutenberg,代碼行數:40,代碼來源:GenericBoxNodeProcessor.java

示例15: onRender

import com.itextpdf.text.pdf.PdfPTable; //導入方法依賴的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);
	}
}
 
開發者ID:Billes,項目名稱:pdf-renderer,代碼行數:46,代碼來源:TableParagraph.java


注:本文中的com.itextpdf.text.pdf.PdfPTable.setSpacingAfter方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。