Package org.apache.pdfbox.pdmodel.fdf

Examples of org.apache.pdfbox.pdmodel.fdf.FDFDocument


     *
     * @throws IOException If there is an error getting the document.
     */
    public FDFDocument getFDFDocument() throws IOException
    {
        return new FDFDocument( getDocument() );
    }
View Full Code Here


    }

    private void importFDF( String[] args ) throws Exception
    {
        PDDocument pdf = null;
        FDFDocument fdf = null;

        try
        {
            if( args.length != 3 )
            {
View Full Code Here

     * @return An FDF document used to export the document.
     * @throws IOException If there is an error when exporting the document.
     */
    public FDFDocument exportFDF() throws IOException
    {
        FDFDocument fdf = new FDFDocument();
        FDFCatalog catalog = fdf.getCatalog();
        FDFDictionary fdfDict = new FDFDictionary();
        catalog.setFDF( fdfDict );

        List fdfFields = new ArrayList();
        List fields = getFields();
View Full Code Here

        File filePDF = new File(PDF_FREEDOM);
        File fileFDF = new File(FDF_FREEDOM);
        if (filePDF.exists() && fileFDF.exists())
        {
            PDDocument freedom = null;
            FDFDocument fdf = null;
            try
            {
                freedom = PDDocument.load( filePDF );
                fdf = FDFDocument.load( fileFDF );
                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" );
   
                //the appearance stream is suppose to be null because there
                //is an F action in the AA dictionary that populates that field.
                PDField totalAmt = form.getField( "eeSuppTotalAmt" );
                assertTrue( totalAmt.getDictionary().getDictionaryObject( "AP" ) == null );
   
            }
            finally
            {
                if( freedom != null )
                {
                    freedom.close();
                }
                if( fdf != null )
                {
                    fdf.close();
                }
            }
        }
    }
View Full Code Here

     *
     * @throws IOException If there is an error getting the document.
     */
    public FDFDocument getFDFDocument() throws IOException
    {
        return new FDFDocument( getDocument() );
    }
View Full Code Here

     *
     * @throws IOException If there is an error getting the document.
     */
    public FDFDocument getFDFDocument() throws IOException
    {
        return new FDFDocument( getDocument() );
    }
View Full Code Here

TOP

Related Classes of org.apache.pdfbox.pdmodel.fdf.FDFDocument

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.