I have a java agent which gets a handle on a notes document… I can pull values from this document etc etc.
I have a public class from iText to create my header and footers on the pdf this code will generate… however… I can not figure out how to pass the notes document to this new class.
early in my agent \
writer.setPageEvent(new EndPage());
calls\
public class EndPage extends PdfPageEventHelper{…
anyway to send the notes document to this class to continue processing?
Subject: Java class… need to pass lotus domino document
Basically you have two Java classes: JavaAgent and EndPage.You have a java object in JavaAgent class which you need to pass on to the second class EndPage.
Well, I can see that, you are in control of source code for both of these classes. It’s very straight forward then. Declare a member variable in EndPage class to hold a Notes Document. And make sure you initialize this member variable, by way of a contructor - wherein you pass on Notes Document object from first class, while an object of EndPage class is being created.
Does that make sense?
public class EndPage extends PdfPageEventHelper {
lotus.domino.Document doc;
public EndPage(lotus.domino.Document d){
super();
doc = d;
}
public void onEndPage(PdfWriter writer, Document document) {
//use value from doc object here
}
}
And in the NotesAgent class pass on the Notes Document object:
Subject: RE: Java class… need to pass lotus domino document
Thank you… that is what I needed.
Sadly nothing is straight forward in Java for me… this is my first attempt at doing anything with Java. I am basically building order confirmation OR invoices if you will in pdf format. Now that I got my headers and footers I am trying to dynamically populate a detail table that must completely fill in the space between the header and footer and when necessary start a new page. Pretty darn close… just cant get the next page working right.
if you wanna help finish this project and make a few bucks let me know at mark_mgl at yahoo dot com. :o)