解密pdf-1(创建一个简单的pdf文件)
时间:2010-10-11 来源:xue2
关键字: pdf pdf是我非常喜欢的文件格式
也是用得很广的
因为它支持多种加密 适合作为财务,报表等的输出
也适合进行电子书的创建
它又是跨平台的文件 无论是windows mac linux 都可以很好的查看
下面的demo是一个简单的入门
算是一个标准的pdf创建过程
package test.pdf;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Paragraph;
import com.lowagie.text.pdf.PdfWriter;
public class Simple1 {
public static void main(String[] args) throws FileNotFoundException, DocumentException {
Document doc = new Document();
PdfWriter.getInstance(doc, new FileOutputStream("E:/HelloWorld.pdf"));
doc.open();
doc.add(new Paragraph("Hello World !"));
doc.close();
}
}
- lib.rar (2.5 MB)
- 下载次数: 11
相关阅读 更多 +










