I got NullPointerException in the below code,and the exception message is like
this java.lang.NullPointerException at
com.lowagie.text.pdf.PdfDocument.open(Unknown Source),I don't know why it
is,can someone help me out of this trouble?THank you very much!
Code:
PdfDocument doc = new PdfDocument();
doc.setMargins(50, 50, 50, 50);
doc.setPageSize(rect);
doc.setFooter(footer);
doc.addTitle("公证书");
doc.addAuthor("Author");
doc.addSubject("Example.");
doc.addKeywords("iText");
doc.addCreator("My program using iText");
try {
// 设置pdf文件生成路径 step2
PdfWriter.getInstance(doc, new FileOutputStream(file));
// 打开pdf文件 step3
doc.open();
_________________________________________________________________
Messenger安全保护中心,免费修复系统漏洞,保护Messenger安全!
http://im.live.cn/safe/------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions:
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/