您的位置:首页 > 其它

生成pdf,使用itext

2007-02-13 12:32 260 查看
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ResourceBundle;

import com.ftc.util.api.SFException;
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Paragraph;
import com.lowagie.text.pdf.PdfReader;
import com.lowagie.text.pdf.PdfWriter;

public class TestPdf{
public static void main(String args[]){
Document document = new Document();

try

{
PdfWriter.getInstance(document, new FileOutputStream ("F06020dpbb1.pdf"));
document.open();

document.add(new Paragraph("F06020dpbb1幫助文檔"));

document.close();
}

catch(DocumentException de)

{
System.err.println(de.getMessage());

}

catch(IOException ioe)

{
System.err.println(ioe.getMessage());

}
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: