public static void createPdf(String filename, String dbTable) throws SQLException, DocumentException, IOException {
// step 1
Document document = new Document(PageSize.A4);
// System.out.println(Tax.class.getResource("fonts/arial.ttf").getPath());
BaseFont bf = BaseFont.createFont("etc/Arial.ttf", "Cp1253", BaseFont.EMBEDDED);
// step 2
PdfWriter.getInstance(document, new FileOutputStream(filename));
// step 3
document.open();
// step 4
PdfPTableEvent event = new Printer();
PdfPTable table = getTable(dbTable, bf);
table.setTableEvent(event);
document.add(table);
document.newPage();
// step 5
document.close();
}
Printer.java 文件源码
java
阅读 28
收藏 0
点赞 0
评论 0
项目:EnTax
作者:
评论列表
文章目录