Examples of FDFDocument


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

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

    }

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

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

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

     * @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

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

        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

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

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

Examples of org.pdfbox.pdmodel.fdf.FDFDocument

    }

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

        try
        {
            if( args.length != 3 )
            {
                usage();
            }
            else
            {
                ImportFDF importer = new ImportFDF();
                pdf = PDDocument.load( args[0] );
                fdf = FDFDocument.loadXFDF( args[1] );

                importer.importFDF( pdf, fdf );
                pdf.save( args[2] );
                fdf.save( "tmp/outputXFDFtoPDF.fdf");
            }
        }
        finally
        {
            close( fdf );
View Full Code Here

Examples of org.pdfbox.pdmodel.fdf.FDFDocument

     * @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

Examples of org.pdfbox.pdmodel.fdf.FDFDocument

     * @throws Exception If there is an error while testing.
     */
    public void testFDFFreedomExpressions() throws Exception
    {
        PDDocument freedom = null;
        FDFDocument fdf = null;
        try
        {
            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" );
           
            //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

Examples of org.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
TOP
Copyright © 2018 www.massapi.com. 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.