use of com.tom_roush.pdfbox.cos.COSBase in project PdfBox-Android by TomRoush.
the class PDFourColours method setColourByIndex.
/**
* Sets the colour by edge index.
*
* @param index the edge index
* @param colour the colour
*/
private void setColourByIndex(int index, PDGamma colour) {
COSBase base;
if (colour == null) {
base = COSNull.NULL;
} else {
base = colour.getCOSArray();
}
this.array.set(index, base);
}
use of com.tom_roush.pdfbox.cos.COSBase in project PdfBox-Android by TomRoush.
the class PDStandardAttributeObject method setFourColors.
/**
* Sets four colours.
*
* @param name the attribute name
* @param value the four colours
*/
protected void setFourColors(String name, PDFourColours value) {
COSBase oldValue = this.getCOSObject().getDictionaryObject(name);
this.getCOSObject().setItem(name, value);
COSBase newValue = value == null ? null : value.getCOSObject();
this.potentiallyNotifyChanged(oldValue, newValue);
}
use of com.tom_roush.pdfbox.cos.COSBase in project PdfBox-Android by TomRoush.
the class PDStandardAttributeObject method setNumber.
/**
* Sets a float number.
*
* @param name the attribute name
* @param value the float number
*/
protected void setNumber(String name, float value) {
COSBase oldBase = this.getCOSObject().getDictionaryObject(name);
this.getCOSObject().setFloat(name, value);
COSBase newBase = this.getCOSObject().getDictionaryObject(name);
this.potentiallyNotifyChanged(oldBase, newBase);
}
use of com.tom_roush.pdfbox.cos.COSBase in project PdfBox-Android by TomRoush.
the class PDStandardAttributeObject method getArrayOfString.
/**
* Gets an array of strings.
*
* @param name the attribute name
* @return the array of strings
*/
protected String[] getArrayOfString(String name) {
COSBase v = this.getCOSObject().getDictionaryObject(name);
if (v instanceof COSArray) {
COSArray array = (COSArray) v;
String[] strings = new String[array.size()];
for (int i = 0; i < array.size(); i++) {
strings[i] = ((COSName) array.getObject(i)).getName();
}
return strings;
}
return null;
}
use of com.tom_roush.pdfbox.cos.COSBase in project PdfBox-Android by TomRoush.
the class PDStandardAttributeObject method setName.
/**
* Sets a name value.
*
* @param name the attribute name
* @param value the name value
*/
protected void setName(String name, String value) {
COSBase oldBase = this.getCOSObject().getDictionaryObject(name);
this.getCOSObject().setName(name, value);
COSBase newBase = this.getCOSObject().getDictionaryObject(name);
this.potentiallyNotifyChanged(oldBase, newBase);
}
Aggregations