本文整理汇总了Java中com.lowagie.text.Table.setSpacing方法的典型用法代码示例。如果您正苦于以下问题:Java Table.setSpacing方法的具体用法?Java Table.setSpacing怎么用?Java Table.setSpacing使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.lowagie.text.Table
的用法示例。
在下文中一共展示了Table.setSpacing方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initTable
import com.lowagie.text.Table; //导入方法依赖的package包/类
/**
* Initialize the main info holder table.
*
* @throws BadElementException
* for errors during table initialization
*/
protected void initTable() throws BadElementException {
tablePDF = new Table(this.model.getNumberOfColumns());
tablePDF.setDefaultVerticalAlignment(Element.ALIGN_TOP);
tablePDF.setCellsFitPage(true);
tablePDF.setWidth(100);
tablePDF.setPadding(2);
tablePDF.setSpacing(0);
// smallFont = FontFactory.getFont(FontFactory.HELVETICA, 7,
// Font.NORMAL, new Color(0, 0, 0));
smallFont = FontFactory.getFont("STSong-Light", "UniGB-UCS2-H", Font.DEFAULTSIZE);
}
示例2: createTable
import com.lowagie.text.Table; //导入方法依赖的package包/类
/**
* creates a Table for reports
*
* @param nbOfColumns
* the number of columns for the table
* @param padding
* the space padding for the table
* @param spacing
* the spacing for the table
* @param width
* the width of the table
*
* @return Table the table ready to use
*
*/
public static Table createTable(int nbOfColumns, int padding, int spacing, int width) {
try {
Table table = new Table(nbOfColumns);
table.setBorderWidth(0f);
table.setPadding(padding);
table.setSpacing(spacing);
table.setWidth(width);
return table;
} catch (Exception e) {
jUCMNavErrorDialog error = new jUCMNavErrorDialog(e.getMessage());
e.printStackTrace();
return null;
}
}
示例3: initTable
import com.lowagie.text.Table; //导入方法依赖的package包/类
/**
* Initialize the main info holder table.
*
* @throws BadElementException
* for errors during table initialization
* @throws NetxiliaBusinessException
* @throws NetxiliaResourceException
*/
protected Table initTable(ISheet sheet) throws BadElementException, NetxiliaResourceException,
NetxiliaBusinessException {
Table tablePDF = new Table(sheet.getDimensions().getNonBlocking().getColumnCount() + 1);
// tablePDF.setDefaultVerticalAlignment(Element.ALIGN_TOP);
// tablePDF.setCellsFitPage(true);
// tablePDF.setWidth(100);
tablePDF.setPadding(2);
tablePDF.setSpacing(0);
return tablePDF;
}
示例4: writePdf
import com.lowagie.text.Table; //导入方法依赖的package包/类
/**
* Ecrit le pdf.
*
* @param table
* MBasicTable
* @param out
* OutputStream
* @throws IOException
* e
*/
protected void writePdf(final MBasicTable table, final OutputStream out) throws IOException {
try {
// step 1: creation of a document-object
final Rectangle pageSize = landscape ? PageSize.A4.rotate() : PageSize.A4;
final Document document = new Document(pageSize, 50, 50, 50, 50);
// step 2: we create a writer that listens to the document and directs a PDF-stream to out
createWriter(table, document, out);
// we add some meta information to the document, and we open it
document.addAuthor(System.getProperty("user.name"));
document.addCreator("JavaMelody");
final String title = buildTitle(table);
if (title != null) {
document.addTitle(title);
}
document.open();
// ouvre la boîte de dialogue Imprimer de Adobe Reader
// if (writer instanceof PdfWriter) {
// ((PdfWriter) writer).addJavaScript("this.print(true);", false);
// }
// table
final Table datatable = new Table(table.getColumnCount());
datatable.setCellsFitPage(true);
datatable.setPadding(4);
datatable.setSpacing(0);
// headers
renderHeaders(table, datatable);
// data rows
renderList(table, datatable);
document.add(datatable);
// we close the document
document.close();
} catch (final DocumentException e) {
// on ne peut déclarer d'exception autre que IOException en throws
throw new IOException(e);
}
}