use of org.apache.xmpbox.type.TextType in project pdfbox by apache.
the class PhotoshopSchema method setICCProfile.
public void setICCProfile(String text) {
TextType tt = (TextType) instanciateSimple(ICC_PROFILE, text);
setICCProfileProperty(tt);
}
use of org.apache.xmpbox.type.TextType in project pdfbox by apache.
the class PhotoshopSchema method setCredit.
public void setCredit(String text) {
TextType tt = (TextType) instanciateSimple(CREDIT, text);
setCreditProperty(tt);
}
use of org.apache.xmpbox.type.TextType in project pdfbox by apache.
the class XMPBasicSchema method setNickname.
/**
* Set a short informal name for the resource
*
* @param text
* the Nickname value to set
*/
public void setNickname(String text) {
TextType tt = (TextType) instanciateSimple(NICKNAME, text);
setNicknameProperty(tt);
}
use of org.apache.xmpbox.type.TextType in project pdfbox by apache.
the class XMPMediaManagementSchema method setVersionID.
/**
* Set VersionId value
*
* @param value
* VersionId value to set
*/
public void setVersionID(String value) {
TextType tt = (TextType) instanciateSimple(VERSIONID, value);
setVersionIDProperty(tt);
}
use of org.apache.xmpbox.type.TextType in project pdfbox by apache.
the class XMPSchema method setUnqualifiedLanguagePropertyValue.
/**
* Set the value of a multi-lingual property.
*
* @param name
* The name of the property, it must include the namespace prefix, e.g. "pdf:Keywords"
* @param language
* The language code of the value. If null then "x-default" is assumed.
* @param value
* The value of the property in the specified language.
*/
public void setUnqualifiedLanguagePropertyValue(String name, String language, String value) {
if (language == null || language.isEmpty()) {
language = XmpConstants.X_DEFAULT;
}
AbstractField property = getAbstractProperty(name);
ArrayProperty arrayProp;
if (property != null) {
// Analyzing content of property
if (property instanceof ArrayProperty) {
arrayProp = (ArrayProperty) property;
// Try to find a definition
for (AbstractField child : arrayProp.getContainer().getAllProperties()) {
// try to find the same lang definition
if (child.getAttribute(XmpConstants.LANG_NAME).getValue().equals(language)) {
// the same language has been found
arrayProp.getContainer().removeProperty(child);
if (value != null) {
TextType langValue = createTextType(XmpConstants.LIST_NAME, value);
langValue.setAttribute(new Attribute(XMLConstants.XML_NS_URI, XmpConstants.LANG_NAME, language));
arrayProp.getContainer().addProperty(langValue);
}
reorganizeAltOrder(arrayProp.getContainer());
return;
}
}
// if no definition found, we add a new one
TextType langValue = createTextType(XmpConstants.LIST_NAME, value);
langValue.setAttribute(new Attribute(XMLConstants.XML_NS_URI, XmpConstants.LANG_NAME, language));
arrayProp.getContainer().addProperty(langValue);
reorganizeAltOrder(arrayProp.getContainer());
}
} else {
arrayProp = createArrayProperty(name, Cardinality.Alt);
TextType langValue = createTextType(XmpConstants.LIST_NAME, value);
langValue.setAttribute(new Attribute(XMLConstants.XML_NS_URI, XmpConstants.LANG_NAME, language));
arrayProp.getContainer().addProperty(langValue);
addProperty(arrayProp);
}
}
Aggregations