Is anyone running any apps using java calls to iText with the 5.1.1 version?? I'm trying to write just a quick one line output PDF document using the iText example as a guide, and converting it to RPG / Java calls.
Here is their example code:
My step 1, 2, 3, & 5 work in my RPG app. If I omit step 4, then the program runs, but fails on the close because there are no pages in the document. Since I didnt output any, this is expected.
The problem is with step 4. When I call the document.add method and pass it a "PARAGRAPH", the method fails because it doesnt find a method. Sure enough, when I look at the document class in the itextpdf-5.1.1.jar file, I dont see an add method with a paragraph being passed.
Yet, they have one in their example.
So I'm just checking to see if anyone has any code with this current release going. Cause I'm going blind trying to figure out how they are able to call a method in a class that I dont see listed.
Here is their example code:
Code:
public void createPdf(String filename) throws DocumentException, IOException { // step 1 Document document = new Document(); // step 2 PdfWriter.getInstance(document, new FileOutputStream(filename)); // step 3 document.open(); [COLOR=#ff0000] // step 4 document.add(new Paragraph("Hello World!")); [/COLOR] // step 5 document.close(); } }
The problem is with step 4. When I call the document.add method and pass it a "PARAGRAPH", the method fails because it doesnt find a method. Sure enough, when I look at the document class in the itextpdf-5.1.1.jar file, I dont see an add method with a paragraph being passed.
Yet, they have one in their example.
So I'm just checking to see if anyone has any code with this current release going. Cause I'm going blind trying to figure out how they are able to call a method in a class that I dont see listed.
Comment