Is it possible to add a constructor to a PDF generator instead of manually typing down the string?
<p>Hi guys so i'm currently trying out the PDF generator for Java and was wondering if it was possible to add a constructor from a different class instead of manually typing down the string.
For example instead of paragraph.add("Your String Here"); 
Will it be possible to type down paragraph.add(account.welcome());
I tried doing this but it returned an error.</p>

<p>The PDF generator code that i'm using right now is:</p>

<pre><code>package demo;

import com.itextpdf.text.Document;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.Image;
import com.itextpdf.text.Paragraph;
import com.itextpdf.text.pdf.PdfWriter;
import java.io.*;

public class PDFGenerateDemo {

    public static void main(String[] args) 
        throws Exception {

        Document document = new Document();
         PdfWriter.getInstance(document,
          new FileOutputStream("/Users/PandaFunk/Desktop/images/sample.pdf"));

      document.open();
      Paragraph paragraph = new Paragraph();

      paragraph.add("Hello World\n");
      paragraph.add("PDF sample generation demo\n");
      paragraph.add("programmed by Mon Zalameda\n");
      paragraph.add("DLS-CSB is a wonderful school. "
            + "I will miss you and hope "
            + "to see you again.\n\n");

      //adding Image
      Image csbImage = 
            Image.getInstance("/Users/PandaFunk/Desktop/images/DLS-CSB_Seal.png");

      document.add(paragraph);
      document.add(csbImage);
      document.close();
    }
}
</code></pre>

<p>UPDATE: Here's the class i'm trying to use</p>

<pre><code>package model;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.MalformedURLException;

import com.itextpdf.text.Document;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.Image;
import com.itextpdf.text.Paragraph;
import com.itextpdf.text.pdf.PdfWriter;

public class SECB extends BankBSP implements 
    PSERequirement{

    public String name = "Security Bank";

    public void welcome() {
        System.out.println("Maligayang pagdating sa " + name);  

    }

    public void depositAmountRequirement() {
        System.out.println("To open an account, "
                + "minimum deposit amount is P3,000.00");
    }

    public void depositPromo() {
        System.out.println("Minimum opening amount of at least "
            + "Php500,000.00 will get you a dinner date with "
            + "2014 Ms. World Megan Young.");
    }

    public void maintainingBalance() {
        System.out.println("Maintaining balance of "
            + "at least Php1,000.00 is required");
    }

    public void interestRate() {
        System.out.println("Minimum deposit amount of P3,000.00 "
            + "to earn an interest rate of 5% per annum.");
    }

    public void displayFinancialStatement() {
        System.out.println("PSE Requirement: " 
            + MIN_LARGE_CAPITALIZATION);
        System.out.println(name + " 2015 "
            + "Financial Assets: Php141,740,664,644.70");
    }

    public void displayTotalMarketShares() {
        System.out.println("PSE Required Shares: " 
            + MIN_SHARES_SOLD);
        System.out.println(name + "total shares: " + 
            "753,538,887");
    }


    public void GeneratePDF() throws DocumentException, MalformedURLException, IOException{

        Document document = new Document();
         PdfWriter.getInstance(document,new FileOutputStream("/Users/PandaFunk/Desktop/images/sample.pdf"));

     document.open();
     Paragraph paragraph = new Paragraph();
     paragraph.add(welcome.toString());
     paragraph.add("Hello World\n");
     paragraph.add("PDF sample generation demo\n");
     paragraph.add("programmed by Mon Zalameda\n");
     paragraph.add("DLS-CSB is a wonderful school. "
            + "I will miss you and hope "
            + "to see you again.\n\n");

     //adding Image
     Image csbImage = Image.getInstance("/Users/PandaFunk/Desktop/images/DLS-CSB_Seal.png");

     document.add(paragraph);
     document.add(csbImage);
     document.close();
    }
}
</code></pre>