Class XmpWriter

  • Direct Known Subclasses:
    PdfAXmpWriter

    public class XmpWriter
    extends Object
    With this class you can create an Xmp Stream that can be used for adding Metadata to a PDF Dictionary. Remark that this class doesn't cover the complete XMP specification.
    • Method Detail

      • getXmpMeta

        public XMPMeta getXmpMeta()
      • setReadOnly

        public void setReadOnly()
        Sets the XMP to read-only
      • setAbout

        public void setAbout​(String about)
        Parameters:
        about - The about to set.
      • setProperty

        public void setProperty​(String schemaNS,
                                String propName,
                                Object value)
                         throws XMPException
        Parameters:
        schemaNS - The namespace URI for the property. Has the same usage as in getProperty.
        propName - The name of the property. Has the same usage as in getProperty().
        value - the value for the property (only leaf properties have a value). Arrays and non-leaf levels of structs do not have values. Must be null if the value is not relevant.
        The value is automatically detected: Boolean, Integer, Long, Double, XMPDateTime and byte[] are handled, on all other toString() is called.
        Throws:
        XMPException - Wraps all errors and exceptions that may occur.
      • appendArrayItem

        public void appendArrayItem​(String schemaNS,
                                    String arrayName,
                                    String value)
                             throws XMPException
        Simplifies the construction of an array by not requiring that you pre-create an empty array. The array that is assigned is created automatically if it does not yet exist. Each call to appendArrayItem() appends an item to the array.
        Parameters:
        schemaNS - The namespace URI for the array.
        arrayName - The name of the array. May be a general path expression, must not be null or the empty string.
        value - the value of the array item.
        Throws:
        XMPException - Wraps all errors and exceptions that may occur.
      • appendOrderedArrayItem

        public void appendOrderedArrayItem​(String schemaNS,
                                           String arrayName,
                                           String value)
                                    throws XMPException
        Simplifies the construction of an ordered array by not requiring that you pre-create an empty array. The array that is assigned is created automatically if it does not yet exist. Each call to appendArrayItem() appends an item to the array.
        Parameters:
        schemaNS - The namespace URI for the array.
        arrayName - The name of the array. May be a general path expression, must not be null or the empty string.
        value - the value of the array item.
        Throws:
        XMPException - Wraps all errors and exceptions that may occur.
      • appendAlternateArrayItem

        public void appendAlternateArrayItem​(String schemaNS,
                                             String arrayName,
                                             String value)
                                      throws XMPException
        Simplifies the construction of an alternate array by not requiring that you pre-create an empty array. The array that is assigned is created automatically if it does not yet exist. Each call to appendArrayItem() appends an item to the array.
        Parameters:
        schemaNS - The namespace URI for the array.
        arrayName - The name of the array. May be a general path expression, must not be null or the empty string.
        value - the value of the array item.
        Throws:
        XMPException - Wraps all errors and exceptions that may occur.