xPages and iText

Dear sir/madam,

Currently I have a SSJ library which creates csv files on the fly using a bit of java ( fileoutputstreams ) and embed these files on an richtextitem. This works fine. Now I need to change this logic to create PDF files. I searched the internet and found iText and played a bit with it inside eclipse just to get it started in a normal java project and the hello world example found on the itext page works in eclipse.

But when I want to use it using xPages it stops working. I add the jar file to the nsf project (using this tip:http://www.jmackey.net/groupwareinc/johnblog/johnblog.nsf/d6plinks/GROC-7G9GT4 ) and when I do document.close()) the xpages returns an error saying:

“the.document.has.no.pages”

the code I have used is:

var doc:com.itextpdf.text.Document = new com.itextpdf.text.Document(com.itextpdf.text.PageSize.A4);

		var writer = com.itextpdf.text.pdf.PdfWriter.getInstance(doc,new java.io.FileOutputStream("test.pdf"));

		doc.open();

		var para = new com.itextpdf.text.Paragraph("Hello world");

		

		doc.add(para);

		doc.close();

Does anyone here have experience with using itext within a notes database and can tell me what is happening? When I try to create a notes agent which creates pdf documents I get the error that an resource for a specific font can not be found so something is wrong but what, I cant find out.

Subject: Fixed

I successfully created an agent which creates the specified pdf file. The problem was the security of the agent. The agent should have the right to do restricted operations.