Example usage for com.itextpdf.text.pdf XfaForm isXfaPresent

List of usage examples for com.itextpdf.text.pdf XfaForm isXfaPresent

Introduction

In this page you can find the example usage for com.itextpdf.text.pdf XfaForm isXfaPresent.

Prototype

public boolean isXfaPresent() 

Source Link

Document

Returns true if it is a XFA form.

Usage

From source file:edu.clemson.lph.pdfgen.PDFUtils.java

License:Open Source License

/**
 * Use iText 5.x to determine whether a PDF contains an XFA form.
 * @param pdfDataIn/* ww  w.  j  a  v a 2  s .  c  om*/
 * @return
 */
public static boolean isXFA(byte[] pdfDataIn) {
    boolean bRet = false;
    PdfReader reader;
    try {
        reader = new PdfReader(pdfDataIn);
        XfaForm form = new XfaForm(reader);
        bRet = form.isXfaPresent();
    } catch (IOException e) {
        logger.error(e);
        bRet = false;
    } catch (ParserConfigurationException e) {
        logger.error(e);
        bRet = false;
    } catch (SAXException e) {
        logger.error(e);
        bRet = false;
    }
    return bRet;
}

From source file:gov.nih.nci.firebird.service.pdf.PdfServiceBean.java

License:Open Source License

private boolean isXfaForm(PdfReader reader) {
    AcroFields acroFields = reader.getAcroFields();
    XfaForm xfa = acroFields.getXfa();
    return xfa.isXfaPresent();
}