com.spire.pdf.interchange.metadata
Class PdfXmpMetadata

java.lang.Object
  extended by com.spire.pdf.interchange.metadata.PdfXmpMetadata

public class PdfXmpMetadata
extends java.lang.Object

A metadata stream containing metadata for document.


Constructor Summary
PdfXmpMetadata()
           
PdfXmpMetadata(PdfStream stream)
          A constructor for a existing metadata stream.
 
Method Summary
 void clear()
          Clear content in Metadata.
 void deleteProperty(java.lang.String schemaNs, java.lang.String propName)
          Deletes the given XMP subtree rooted at the given property.
 void dispose()
          Releases all resources used.
 boolean existProperty(java.lang.String schemaNs, java.lang.String propName)
          Returns whether the property exists.
 com.spire.ms.System.DateTime getPropertyDate(java.lang.String schemaNs, java.lang.String propName)
          Convenience method to retrieve the literal value of a property.
 java.lang.String getPropertyString(java.lang.String schemaNs, java.lang.String propName)
          Convenience method to retrieve the literal value of a property.
static PdfXmpMetadata parse(com.spire.ms.System.IO.Stream stream)
          Parse the xmp metadata.
 void setPropertyDate(java.lang.String schemaNs, java.lang.String propName, com.spire.ms.System.DateTime propValue)
          
 void setPropertyString(java.lang.String schemaNs, java.lang.String propName, java.lang.String propValue)
          
 

Constructor Detail

PdfXmpMetadata

public PdfXmpMetadata()

PdfXmpMetadata

public PdfXmpMetadata(PdfStream stream)
A constructor for a existing metadata stream.

Parameters:
stream - A existing metadata stream.
Method Detail

existProperty

public boolean existProperty(java.lang.String schemaNs,
                             java.lang.String propName)
Returns whether the property exists.

Parameters:
schemaNs - The namespace URI for the property. Has the same usage as in .
propName - The name of the property. Has the same usage as in .
Returns:
Returns true if the property exists.

deleteProperty

public void deleteProperty(java.lang.String schemaNs,
                           java.lang.String propName)
Deletes the given XMP subtree rooted at the given property. It is not an error if the property does not exist.

Parameters:
schemaNs - The namespace URI for the property. Has the same usage as in .
propName - The name of the property. Has the same usage as in .

setPropertyString

public void setPropertyString(java.lang.String schemaNs,
                              java.lang.String propName,
                              java.lang.String propValue)

Parameters:
schemaNs - The namespace URI
propName - The name of the property
propValue - The value for the property

getPropertyString

public java.lang.String getPropertyString(java.lang.String schemaNs,
                                          java.lang.String propName)
Convenience method to retrieve the literal value of a property. Note that there is no setPropertyString()z, because sets a string value.

Parameters:
schemaNs - The namespace URI for the property. Has the same usage as in .
propName - The name of the property. Has the same usage as in .
Returns:
Returns a string value or null if the property does not exist.

setPropertyDate

public void setPropertyDate(java.lang.String schemaNs,
                            java.lang.String propName,
                            com.spire.ms.System.DateTime propValue)

Parameters:
schemaNs - The namespace URI
propName - The name of the property
propValue - The value for the property

getPropertyDate

public com.spire.ms.System.DateTime getPropertyDate(java.lang.String schemaNs,
                                                    java.lang.String propName)
Convenience method to retrieve the literal value of a property.

Parameters:
schemaNs - The namespace URI for the property. Has the same usage as in .
propName - The name of the property. Has the same usage as in .
Returns:
Returns a IXmpDateTime object or null if the property does not exist.

clear

public void clear()
Clear content in Metadata.


parse

public static PdfXmpMetadata parse(com.spire.ms.System.IO.Stream stream)
Parse the xmp metadata.

Parameters:
stream - The xmp metadata stream.
Returns:
The PdfXmpMetadata.

dispose

public void dispose()
Releases all resources used.