import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStream;
import com.itextpdf.text.Document;
import com.itextpdf.text.Paragraph;
import com.itextpdf.text.pdf.PdfWriter;

public class Main {

    public static void main(String[] args) {
        try {
            Document document = new Document();

            OutputStream outputStream = new FileOutputStream(new File("TestFile.pdf"));

            PdfWriter.getInstance(document, outputStream);

            document.open();

            document.add(new Paragraph("In" + "this is a test pdf file."));

            document.close();
            outputStream.close();

            System.out.println("Yeah");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
