public PDDocument createPDFFromText( Reader text ) throws IOException
    {
        PDDocument doc = new PDDocument();
        createPDFFromText(doc, text);
        return doc;
    }
@Test
    void testFormFeed() throws IOException
    {
        TextToPDF pdfCreator = new TextToPDF();
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        StringReader reader = new StringReader("First page\fSecond page\f\nThird page");
        try (PDDocument doc = pdfCreator.createPDFFromText(reader))
        {
            doc.save(baos);
        }
        try (PDDocument doc = Loader.loadPDF(baos.toByteArray()))
        {
            assertEquals(3, doc.getNumberOfPages());
            PDFTextStripper stripper = new PDFTextStripper();
            stripper.setStartPage(1);
            stripper.setEndPage(1);
            assertEquals("First page", stripper.getText(doc).trim());
            stripper.setStartPage(2);
            stripper.setEndPage(2);
            assertEquals("Second page", stripper.getText(doc).trim());
            stripper.setStartPage(3);
            stripper.setEndPage(3);
            assertEquals("Third page", stripper.getText(doc).trim());
        }
    }