Package org.pdfbox.pdmodel.interactive.form

Examples of org.pdfbox.pdmodel.interactive.form.PDTextbox


        PDDocument doc = null;
        try
        {
            doc = new PDDocument();
            PDAcroForm form = new PDAcroForm( doc );
            PDTextbox textBox = new PDTextbox(form);
           
            //assert that default is false.
            assertFalse( textBox.shouldComb() );
           
            //try setting and clearing a single field
            textBox.setComb( true );
            assertTrue( textBox.shouldComb() );
            textBox.setComb( false );
            assertFalse( textBox.shouldComb() );
           
            //try setting and clearing multiple fields
            textBox.setComb( true );
            textBox.setDoNotScroll( true );
            assertTrue( textBox.shouldComb() );
            assertTrue( textBox.doNotScroll() );
           
            textBox.setComb( false );
            textBox.setDoNotScroll( false );
            assertFalse( textBox.shouldComb() );
            assertFalse( textBox.doNotScroll() );
           
            //assert that setting a field to false multiple times works
            textBox.setComb( false );
            assertFalse( textBox.shouldComb() );
            textBox.setComb( false );
            assertFalse( textBox.shouldComb() );
           
            //assert that setting a field to true multiple times works
            textBox.setComb( true );
            assertTrue( textBox.shouldComb() );
            textBox.setComb( true );
            assertTrue( textBox.shouldComb() );
           
           
           
           
           
View Full Code Here


        PDDocument fdeb = null;
        try
        {
            fdeb = PDDocument.load( "test/input/fdeb.pdf" );
            PDAcroForm form = fdeb.getDocumentCatalog().getAcroForm();
            PDTextbox field = (PDTextbox)form.getField( "f67_1" );
            field.setValue( "2" );
           
            String expected =
                "/Tx BMC " +
                "BT " +
                "/Helv 9 Tf " +
View Full Code Here

        PDDocument fdeb = null;
        try
        {
            fdeb = PDDocument.load( "test/input/pdf_with_lots_of_fields.pdf" );
            PDAcroForm form = fdeb.getDocumentCatalog().getAcroForm();
            PDTextbox feld2 = (PDTextbox)form.getField( "Feld.2" );
            feld2.setValue( "Benjamin" );
           
            String expected =
            "1 1 0.8000000119 rg " +
            " 0 0 127.5 19.8299999237 re " +
            " f " +
View Full Code Here

        {
            freedom = PDDocument.load( "test/input/FreedomExpressions.pdf" );
            fdf = FDFDocument.load( "test/input/FreedomExpressions.fdf" );
            PDAcroForm form = freedom.getDocumentCatalog().getAcroForm();
            form.importFDF( fdf );
            PDTextbox feld2 = (PDTextbox)form.getField( "eeFirstName" );
            List kids = feld2.getKids();
            PDField firstKid = (PDField)kids.get( 0 );
            PDField secondKid = (PDField)kids.get( 1 );
            testContentStreamContains( freedom, firstKid, "Steve" );
            testContentStreamContains( freedom, secondKid, "Steve" );
           
View Full Code Here

TOP

Related Classes of org.pdfbox.pdmodel.interactive.form.PDTextbox

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.