Skip to main content
Skip table of contents

XmpUtils

XmpUtils Public class

Description

Utility methods for XMP. I included only those that are different from the Java default conversion utilities.

        @since 21.02.2006

Diagram

  flowchart LR
  classDef interfaceStyle stroke-dasharray: 5 5;
  classDef abstractStyle stroke-width:4px
  subgraph iTextSharp.xmp
  iTextSharp.xmp.XmpUtils[[XmpUtils]]
  end

Members

Methods

Public Static methods
ReturnsName
voidAppendProperties(...)
Alias without the new option ...
stringCatenateArrayItems(IXmpMeta xmp, string schemaNs, string arrayName, string separator, string quotes, bool allowCommas)
Create a single edit string from an array of strings.
stringConvertFromBoolean(bool value)
Convert from boolean to string.
stringConvertFromDate(IXmpDateTime value)
Convert from ...
stringConvertFromDouble(double value)
Convert from long to string.
stringConvertFromInteger(int value)
Convert from int to string.
stringConvertFromLong(long value)
Convert from long to string.
boolConvertToBoolean(string value)
IXmpDateTimeConvertToDate(string rawValue)
Converts a string value to an ...
doubleConvertToDouble(string rawValue)
Converts a string value to a ...
intConvertToInteger(string rawValue)
Converts a string value to an ...
longConvertToLong(string rawValue)
Converts a string value to a ...
byte``[]DecodeBase64(string base64String)
Decode from Base64 encoded string to raw data.
stringEncodeBase64(byte``[] buffer)
Convert from a byte array to a base64 encoded string.
voidRemoveProperties(IXmpMeta xmp, string schemaNs, string propName, bool doAllProperties, bool includeAliases)
voidSeparateArrayItems(IXmpMeta xmp, string schemaNs, string arrayName, string catedStr, PropertyOptions arrayOptions, bool preserveCommas)
Separate a single edit string into an array of strings.

Details

Summary

Utility methods for XMP. I included only those that are different from the Java default conversion utilities.

        @since 21.02.2006

Methods

CatenateArrayItems

Source code

public static string CatenateArrayItems(IXmpMeta xmp, string schemaNs, string arrayName, string separator, string quotes, bool allowCommas)
Arguments
TypeNameDescription
IXmpMetaxmpThe XMP object containing the array to be catenated.
stringschemaNsThe schema namespace URI for the array. Must not be null or
the empty string.
stringarrayNameThe name of the array. May be a general path expression, must
not be null or the empty string. Each item in the array must
be a simple string value.
stringseparatorThe string to be used to separate the items in the catenated
string. Defaults to "; ", ASCII semicolon and space
(U+003B, U+0020).
stringquotesThe characters to be used as quotes around array items that
contain a separator. Defaults to '"'
boolallowCommasOption flag to control the catenation.
Summary

Create a single edit string from an array of strings.

Returns

Returns the string containing the catenated array items.

Exceptions
NameDescription
XmpExceptionForwards the Exceptions from the metadata processing
SeparateArrayItems

Source code

public static void SeparateArrayItems(IXmpMeta xmp, string schemaNs, string arrayName, string catedStr, PropertyOptions arrayOptions, bool preserveCommas)
Arguments
TypeNameDescription
IXmpMetaxmpThe XMP object containing the array to be updated.
stringschemaNsThe schema namespace URI for the array. Must not be null or
the empty string.
stringarrayNameThe name of the array. May be a general path expression, must
not be null or the empty string. Each item in the array must
be a simple string value.
stringcatedStrThe string to be separated into the array items.
PropertyOptionsarrayOptionsOption flags to control the separation.
boolpreserveCommasFlag if commas shall be preserved
Summary

Separate a single edit string into an array of strings.

Exceptions
NameDescription
XmpExceptionForwards the Exceptions from the metadata processing
RemoveProperties

Source code

public static void RemoveProperties(IXmpMeta xmp, string schemaNs, string propName, bool doAllProperties, bool includeAliases)
Arguments
TypeNameDescription
IXmpMetaxmp
stringschemaNs
stringpropName
booldoAllProperties
boolincludeAliases
AppendProperties [1/2]

Source code

public static void AppendProperties(IXmpMeta source, IXmpMeta dest, bool doAllProperties, bool replaceOldValues)
Arguments
TypeNameDescription
IXmpMetasourceThe source XMP object.
IXmpMetadestThe destination XMP object.
booldoAllPropertiesDo internal properties in addition to external properties.
boolreplaceOldValuesReplace the values of existing properties.
Summary

Alias without the new option

deleteEmptyValues
Exceptions
NameDescription
XmpExceptionForwards the Exceptions from the metadata processing
AppendProperties [2/2]

Source code

public static void AppendProperties(IXmpMeta source, IXmpMeta dest, bool doAllProperties, bool replaceOldValues, bool deleteEmptyValues)
Arguments
TypeNameDescription
IXmpMetasource
IXmpMetadest
booldoAllProperties
boolreplaceOldValues
booldeleteEmptyValues
ConvertToBoolean

Source code

public static bool ConvertToBoolean(string value)
Arguments
TypeNameDescription
stringvalue
ConvertFromBoolean

Source code

public static string ConvertFromBoolean(bool value)
Arguments
TypeNameDescription
boolvaluea boolean value
Summary

Convert from boolean to string.

Returns

The XMP string representation of the boolean. The values used are given by the constnts and .

ConvertToInteger

Source code

public static int ConvertToInteger(string rawValue)
Arguments
TypeNameDescription
stringrawValuethe string value
Summary

Converts a string value to an

int
Returns

Returns an int.

Exceptions
NameDescription
XmpExceptionIf the ...
ConvertFromInteger

Source code

public static string ConvertFromInteger(int value)
Arguments
TypeNameDescription
intvaluean int value
Summary

Convert from int to string.

Returns

The string representation of the int.

ConvertToLong

Source code

public static long ConvertToLong(string rawValue)
Arguments
TypeNameDescription
stringrawValuethe string value
Summary

Converts a string value to a

long
Returns

Returns a long.

Exceptions
NameDescription
XmpExceptionIf the ...
ConvertFromLong

Source code

public static string ConvertFromLong(long value)
Arguments
TypeNameDescription
longvaluea long value
Summary

Convert from long to string.

Returns

The string representation of the long.

ConvertToDouble

Source code

public static double ConvertToDouble(string rawValue)
Arguments
TypeNameDescription
stringrawValuethe string value
Summary

Converts a string value to a

double
Returns

Returns a double.

Exceptions
NameDescription
XmpExceptionIf the ...
ConvertFromDouble

Source code

public static string ConvertFromDouble(double value)
Arguments
TypeNameDescription
doublevaluea long value
Summary

Convert from long to string.

Returns

The string representation of the long.

ConvertToDate

Source code

public static IXmpDateTime ConvertToDate(string rawValue)
Arguments
TypeNameDescription
stringrawValuethe string value
Summary

Converts a string value to an

XMPDateTime
Returns

Returns an

XMPDateTime
Exceptions
NameDescription
XmpExceptionIf the ...
ConvertFromDate

Source code

public static string ConvertFromDate(IXmpDateTime value)
Arguments
TypeNameDescription
IXmpDateTimevaluean ...
Summary

Convert from

XMPDateTime
Returns

The string representation of the long.

EncodeBase64

Source code

public static string EncodeBase64(byte[] buffer)
Arguments
TypeNameDescription
byte``[]bufferthe byte array to be converted
Summary

Convert from a byte array to a base64 encoded string.

Returns

Returns the base64 string.

DecodeBase64

Source code

public static byte DecodeBase64(string base64String)
Arguments
TypeNameDescription
stringbase64Stringa base64 encoded string
Summary

Decode from Base64 encoded string to raw data.

Returns

Returns a byte array containg the decoded string.

Exceptions
NameDescription
XmpExceptionThrown if the given string is not property base64 encoded

Generated with ModularDoc

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.