欢迎访问悦橙教程(wld5.com),关注java教程。悦橙教程  java问答|  每日更新
页面导航 : > > 文章正文

iText 的简单使用,iText简单使用,[Java]代码 //s

来源: javaer 分享于  点击 295 次 点评:110

iText 的简单使用,iText简单使用,[Java]代码 //s


[Java]代码

 //set pdf location and the title  String pdfLocation = request.getRealPath("/") + "/web/report/pdf/";  String pdfName= "test.pdf";  String pdfFile = pdfLocation + pdfName;        Document document = new Document();  try {     PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(pdfFile));     document.open();     document.add(new Paragraph("Hello world"));  } catch (DocumentException de) {     System.err.println(de.getMessage());  } catch (IOException ioe) {     System.err.println(ioe.getMessage());  } finally {     document.close();  } 
相关栏目:

用户点评