Class PDMetadata

  • All Implemented Interfaces:
    COSObjectable

    public class PDMetadata
    extends PDStream
    This class represents metadata for various objects in a PDF document.
    Version:
    $Revision: 1.3 $
    Author:
    Ben Litchfield
    • Constructor Detail

      • PDMetadata

        public PDMetadata​(PDDocument document)
        This will create a new PDMetadata object.
        Parameters:
        document - The document that the stream will be part of.
      • PDMetadata

        public PDMetadata​(PDDocument doc,
                          java.io.InputStream str,
                          boolean filtered)
                   throws java.io.IOException
        Constructor. Reads all data from the input stream and embeds it into the document, this will close the InputStream.
        Parameters:
        doc - The document that will hold the stream.
        str - The stream parameter.
        filtered - True if the stream already has a filter applied.
        Throws:
        java.io.IOException - If there is an error creating the stream in the document.
      • PDMetadata

        public PDMetadata​(COSStream str)
        Constructor.
        Parameters:
        str - The stream parameter.
    • Method Detail

      • exportXMPMetadata

        @Deprecated
        public org.apache.jempbox.xmp.XMPMetadata exportXMPMetadata()
                                                             throws java.io.IOException
        Deprecated.
        will return an InputStream in the future.
        Extract the XMP metadata and create and build an in memory object. To persist changes back to the PDF you must call importXMPMetadata.
        Returns:
        A parsed XMP object.
        Throws:
        java.io.IOException - If there is an error parsing the XMP data.
      • importXMPMetadata

        public void importXMPMetadata​(byte[] xmp)
                               throws java.io.IOException
        Import an XMP stream into the PDF document.
        Parameters:
        xmp - The XMP data.
        Throws:
        java.io.IOException - If there is an error generating the XML document.
      • importXMPMetadata

        @Deprecated
        public void importXMPMetadata​(org.apache.jempbox.xmp.XMPMetadata xmp)
                               throws java.io.IOException,
                                      javax.xml.transform.TransformerException
        Deprecated.
        Import an XMP stream into the PDF document.
        Parameters:
        xmp - The XMP data.
        Throws:
        java.io.IOException - If there is an error generating the XML document.
        javax.xml.transform.TransformerException - If there is an error generating the XML document.