import com.itextpdf.text.pdf.PdfReader;
import com.itextpdf.text.pdf.parser.PdfTextExtractor;
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 gg {
    public static void main(String[] args) {
        try {
            Document document = new Document();


            OutputStream outputStream =
                    new FileOutputStream(new File("F:\\aaa.pdf"));


            PdfWriter.getInstance(document, outputStream);


            document.open();


            document.add(new Paragraph("Hello world, " +
                    "this is a test pdf aaa bbbbrrrrrrrrrrrrr file."));


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

            System.out.println("Pdf created successfully.");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}


