Interface AcroForm

    • Method Detail

      • writeUpdatedDocument

        boolean writeUpdatedDocument​(OutputStream dest)
                              throws IOException
        If any field values contained in this form have been changed, then this function writes a copy of the PDF document from which this form was read to the given OutputStream, and appends the updated form field values. In this case, this function will always return true. If no field values have been changed, then this function will do nothing, and return false. This function will fail with an exception if the Document from which this form instance was retrieved has been closed.
        Parameters:
        dest - the OutputStream to which the updated PDF document data will be written
        Returns:
        true if any field values in this form have been changed, and updated PDF document data has been written to the given OutputStream; if no field values have been changed, then no data will be written, and false is returned
        Throws:
        IOException - if an error occurs while writing the PDF document data
        Since:
        v2.1
      • getXFAPacketNames

        Set getXFAPacketNames()
                       throws IOException
        Returns a Set of the packet names of the XFA data. Each of the Strings in that set may be passed to getXFAPacketContents(String) to get the contents of that XML element.
        Returns:
        a Set of String objects, corresponding to the packet names of XFA data
        Throws:
        IOException - if an error occurs while reading the PDF document data
      • getXFAPacketContents

        byte[] getXFAPacketContents​(String packetName)
                             throws IOException
        Returns the contents of the XML element referenced by packetName in this form. To get a list of individual packets available in this form, you may call getXFAPacketNames(). If packetName does not exist in this form, null is returned.
        Parameters:
        packetName - the name of the XML packet to be extracted from this form
        Returns:
        the XML contents of the given packet
        Throws:
        IOException - if an error occurs while reading the PDF document data
      • getXFAContents

        byte[] getXFAContents()
                       throws IOException
        Returns the entire XFA contents of this form.
        Returns:
        the XFA contents of this form
        Throws:
        IOException - if an error occurs while reading the PDF document data