Chilkat C# Xmp Class Reference
Xmp
Chilkat XMP is a software component (SDK, toolkit, library, etc) for accessing, manipulating, and adding XMP metadata to JPEG and TIFF files.
Object Creation
(C#)
Chilkat.Xmp obj = new Chilkat.Xmp();
(VB.NET)
Dim obj As New Chilkat.Xmp()
Properties
public string LastErrorHtml {get; }
Error information in HTML format for the last method called.
public string LastErrorText {get; }
Error information in plain-text format for the last method called.
public string LastErrorXml {get; }
Error information in XML format for the last method called.
public int NumEmbedded {get; }
The number of XMP metadata documents found within the JPG or TIFF file loaded by LoadAppFile.
public bool StructInnerDescrip {get; set; }
Determines whether structures are stored with rdf:parseType="Resource", or within an "rdf:Description" sub-node.
public string Version {get; }
The version, such as "1.0" of the XMP toolkit.
Methods
public bool AddArray(Xml xml, string arrType, string propName, StringArray values);
Adds or replaces an XMP property array. The XMP metadata to be updated is contained in the XML object passed in the 1st argument. The 2nd argument specifies the array type, which can be "bag", "seq", or "alt". The property name should be prefixed with the namespace, such as "dc:subject".
public void AddNsMapping(string ns, string uri);
Adds a namespace to URI mapping. When a property is added via AddSimpleString or any of the other methods, the property name is namespace qualified. When adding the first property in a namespace, the rdf:Description is automatically added and the URI is obtained from the namespace-to-URI mappings. The standard (and commonly used) namespace mappings are defined by default. This is only used if the namespace is custom or not already handled.
public bool AddSimpleDate(Xml xml, string propName, DateTime propVal);
Adds or replaces an XMP date property. The XMP metadata to be updated is contained in the XML object passed in the 1st argument. The property name should be prefixed with the namespace, such as "xap:CreateDate".
public bool AddSimpleInt(Xml xml, string propName, int propVal);
Adds or updates an XMP integer property. The XMP metadata to be updated is contained in the XML object passed in the 1st argument. The property name should be prefixed with the namespace, such as "tiff:XResolution".
public bool AddSimpleStr(Xml xml, string propName, string propVal);
Adds or updates a simple XMP string property. The XMP metadata to be updated is contained in the XML object passed in the 1st argument. The property name should be prefixed with the namespace, such as "photoshop:Credit".
public bool AddStructProp(Xml xml, string structName, string propName, string propVal);
Adds or updates an XMP structured property value. The XMP metadata to be updated is contained in the XML object passed in the 1st argument. The structure name should be prefixed with the namespace, such as "Iptc4xmpCore:CreatorContactInfo". The property name within the structure should also be prefixed with the namespace, such as "Iptc4xmpCore:CiAdrCity".
public bool Append(Xml xml);
Appends a new XMP metadata file to the XMP object. Any XMPs appended via this method will be present in the file when SaveAppFile is called. Files containing XMP metadata typically only include a single XMP document, so this method is usually only called when adding XMP metadata to a file for the first time.
public string DateToString(DateTime dt);
Converts a date to a string representation. This method is added for convenience (just in case date-to-string conversions are required). Returns a null on failure
public StringArray GetArray(Xml xml, string propName);
Finds and returns an XMP array property. The property name should be prefixed with the namespace, such as "dc:subject". Returns a null reference on failure
public Xml GetEmbedded(int index);
Returns the Nth embedded XMP document as a Chilkat XML object.
public DateTime GetSimpleDate(Xml xml, string propName);
Finds and returns an XMP date property. The property name should be prefixed with the namespace, such as "xap:ModifyDate".
public int GetSimpleInt(Xml xml, string propName);
Finds and returns an XMP integer property. The property name should be prefixed with the namespace, such as "tiff:ResolutionUnit".
public string GetSimpleStr(Xml xml, string propName);
Finds and returns an XMP simple string property. The property name should be prefixed with the namespace, such as "photoshop:Source". Returns a null on failure
public StringArray GetStructPropNames(Xml xml, string structName);
Returns the property names used by an exsting structure within an XMP document. The contents of the structure can be retrieved by calling GetStructValue for each property name returned by GetStructPropNames. Returns a null reference on failure
public string GetStructValue(Xml xml, string structName, string propName);
Returns the value of a single item within an XMP structure property. Property names should always be prefixed with the namespace. Returns a null on failure
public bool LoadAppFile(string filename);
Loads a TIFF or JPG file into the XMP object.
public bool LoadFromBuffer(byte[] data, string ext);
Loads a JPG or TIFF from an byte buffer containing the image file data.
public Xml NewXmp();
Creates and returns a new/empty XMP metadata document as a Chilkat XML object.
public bool RemoveAllEmbedded();
Removes all XMP metadata documents from an XMP object. After calling this method, call SaveAppFile to rewrite the JPG or TIFF file with the XMP metadata removed.
public bool RemoveArray(Xml xml, string propName);
Removes an XMP array property from the XMP document.
public bool RemoveEmbedded(int index);
Removes a single XMP metadata document from the JPG or TIFF file. Call SaveAppFile to persist the changes to disk.
public void RemoveNsMapping(string ns);
Removes a namespace-to-URI mapping.
public bool RemoveSimple(Xml xml, string propName);
Removes a simple XMP property from the XMP document.
public bool RemoveStruct(Xml xml, string structName);
Removes an XMP structure property from the XMP document.
public bool RemoveStructProp(Xml xml, string structName, string propName);
Removes a single member from an XMP structured property.
public bool SaveAppFile(string filename);
Persists all changes made to the XMP document(s) by saving the XMP object to a file. Changes made by adding, updating, or removing properties are not persisted to the filesystem until this is called.
public bool SaveLastError(string filename);
Saves the last error information to an XML formatted file.
public byte[] SaveToBuffer();
Saves a JPG or TIFF image with updated XMP to a byte buffer. Returns null on failure
public DateTime StringToDate(string str);
Converts a string to a date value. This method is added for convenience (just in case string-to-date conversions are required).
public bool UnlockComponent(string b1);
Unlocks the XMP component at runtime. This must be called once at the beginning of your application. Passing an arbitrary value initiates a fully-functional 30-day trial. A permanent unlock code is required to use the component beyond 30 days.
|