Click or drag to resize

XmpParser Class

The XmpParser class can extract XMP Binary data from an image, and parse it into XML content.
Inheritance Hierarchy
SystemObject
  Atalasoft.Imaging.MetadataXmpParser

Namespace:  Atalasoft.Imaging.Metadata
Assembly:  Atalasoft.dotImage (in Atalasoft.dotImage.dll) Version: 11.4.0.9.0.377 (.NET 4.5.2, x86)
Syntax
public class XmpParser

The XmpParser type exposes the following members.

Constructors
  NameDescription
Public methodXmpParser
Initializes a new instance of XmpParser.
Top
Methods
  NameDescription
Public methodBytesFromImage(Stream)
Returns a byte array containing XMP data from an image stream.
Public methodBytesFromImage(String)
Returns a byte array containing XMP data from an image file.
Public methodBytesFromImage(Stream, Int32)
Returns a byte array containing XMP data from an image stream specifying the frame index.
Public methodBytesFromImage(String, Int32)
Returns a byte array containing XMP data from an image file specifying the frame index.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodOnError
Raises the [E:Error] event.
Public methodParseFromImage(Stream)
Returns an XmlDocument containing XMP data from an image file stream.
Public methodParseFromImage(String)
Returns an XmlDocument containing XMP data from an image file.
Public methodParseFromImage(Stream, Int32)
Returns an XmlDocument containing XMP data from an image file stream and zero based frame index.
Public methodParseFromImage(String, Int32)
Returns an XmlDocument containing XMP data from an image file and zero based frame index.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Events
  NameDescription
Public eventCodecError
Occurs when a codec error has been reported.
Top
Remarks

There are two important methods in this class. BytesFromImage(Stream, Int32) returns a byte array of the raw XMP data. It is used in the DotImage Annotations Toolkit, to load XMP annotations data. ParseFromImage(String, Int32) returns an XmlDocument that can be easily parsed using features in the .NET XML namespace.

For more information on XMP including the specification, visit http://www.adobe.com/products/xmp/.

Examples
[New Example] (C#)
XmpParser xmpParser = new XmpParser();
XmlDocument doc = xmpParser.Parse("document.tif", 1);
[New Example] (Visual Basic)
Dim xmpParser As XmpParser = New XmpParser()
Dim doc As XmlDocument = xmpParser.Parse("document.tif", 1)
See Also