234390216 发表于 2013-1-15 01:58:43

itext生成pdf文件的HelloWorld

public class HelloWorld {public static void main(String args[]) throws FileNotFoundException, DocumentException {String fileName = "pdf/helloWorld.pdf";String content = "Hello World!";create(fileName, content);}private static void create(String fileName, String content) throws DocumentException, FileNotFoundException {//step1Document document = new Document();OutputStream os = new FileOutputStream(fileName);//step2PdfWriter.getInstance(document, os);//step3document.open();//step4document.add(new Paragraph(content));//step5document.close();}} 
页: [1]
查看完整版本: itext生成pdf文件的HelloWorld