首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > PowerDesigner >

itext生成pdf资料的HelloWorld

2012-12-25 
itext生成pdf文件的HelloWorldpublic class HelloWorld {public static void main(String args[]) throws

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();}}

?

热点排行