DZone Forums
Go Back   DZone Forums > Community > Tools & IDEs > Eclipse
Reload this Page iText in Eclipse plugin
Notices
Reply
 
LinkBack Thread Tools Display Modes
  (#1 (permalink)) Old
Member
 
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Feb 2008
Default iText in Eclipse plugin - 05-20-2008, 04:41 PM

Im writing an Eclipse plugin which posses a function of generating pdf files. but im in a really weird situation. when i add this functionality (generation of pdf file) im not able to run the plugin and it doesnt through any exception. i already tried two pdf libraries iText and pdfBox but its the same problem.
Here is the function for generating the pdf file using iText library:


public void createPdf()
{
Document document = new Document();
PdfWriter writer;
try {
writer = PdfWriter.getInstance(document, new FileOutputStream("C:\\aaa\\aaa.pdf"));
document.open();
document.add(new Paragraph("cccccc"));
document.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (DocumentException e) {
e.printStackTrace();
}
}

and pretty much the same function using pdfBox library:


public static void pd()
{
try {
doc = new PDDocument();
PDPage page = new PDPage();
doc.addPage(page);
doc.save("C:\\aaa\\aaa.pdf");
} catch (IOException e) {
e.printStackTrace();
} catch (COSVisitorException e) {
e.printStackTrace();
}
finally
{
if(doc!=null)
try {
doc.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}

Can anyone help with this issue, please?(or this is an Eclipse bug)
Reply With Quote
  (#2 (permalink)) Old
Moderator
 
Posts: 102
Thanks: 0
Thanked 7 Times in 7 Posts
Join Date: Jan 2008
Default 05-27-2008, 06:03 AM

This seems really strange. I presume you've added the iText jar to your plugin's classpath/dependencies?

When debugging did you hit any of the pdf generation code?
James
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
new plugin for Eclipse slover Eclipse 0 01-24-2009 04:31 AM
runing plugin writen in eclipse 3.3 under eclipse 3.2 eladfein@yahoo.com Eclipse 0 07-27-2008 03:37 AM
Eclipse plugin markers baltazar Eclipse 0 03-26-2008 05:34 AM
eclipse plugin baltazar Eclipse 0 03-11-2008 12:48 PM
eclipse plugin eldjon Eclipse 1 02-29-2008 06:03 AM


Copyright 1997-2009, DZone, Inc.
vBulletin Skin developed by: vBStyles.com