use of com.tom_roush.pdfbox.cos.COSString in project PdfBox-Android by TomRoush.
the class COSArrayList method add.
/**
* {@inheritDoc}
*/
@Override
public void add(int index, E element) {
// in the dictionary from a single item to an array.
if (parentDict != null) {
parentDict.setItem(dictKey, array);
// clear the parent dict so it doesn't happen again, there might be
// a usecase for keeping the parentDict around but not now.
parentDict = null;
}
actual.add(index, element);
if (element instanceof String) {
array.add(index, new COSString((String) element));
} else {
array.add(index, ((COSObjectable) element).getCOSObject());
}
}
use of com.tom_roush.pdfbox.cos.COSString in project PdfBox-Android by TomRoush.
the class COSArrayList method toCOSObjectList.
private List<COSBase> toCOSObjectList(Collection<?> list) {
List<COSBase> cosObjects = new ArrayList<COSBase>();
for (Object next : list) {
if (next instanceof String) {
cosObjects.add(new COSString((String) next));
} else {
COSObjectable cos = (COSObjectable) next;
cosObjects.add(cos.getCOSObject());
}
}
return cosObjects;
}
use of com.tom_roush.pdfbox.cos.COSString in project PdfBox-Android by TomRoush.
the class FDFJavaScript method setDoc.
/**
* Sets the dictionary's "Doc" entry.
*
* @param map Map of named "JavaScript" dictionaries.
*/
public void setDoc(Map<String, PDActionJavaScript> map) {
COSArray array = new COSArray();
for (Map.Entry<String, PDActionJavaScript> entry : map.entrySet()) {
array.add(new COSString(entry.getKey()));
array.add(entry.getValue());
}
dictionary.setItem(COSName.DOC, array);
}
use of com.tom_roush.pdfbox.cos.COSString in project PdfBox-Android by TomRoush.
the class PDFontDescriptor method getCharSet.
/**
* This will get the character set for the font.
*
* @return The character set value.
*/
public String getCharSet() {
String retval = null;
COSString name = (COSString) dic.getDictionaryObject(COSName.CHAR_SET);
if (name != null) {
retval = name.getString();
}
return retval;
}
use of com.tom_roush.pdfbox.cos.COSString in project PdfBox-Android by TomRoush.
the class PDFontDescriptor method setFontFamily.
/**
* This will set the font family.
*
* @param fontFamily The font family.
*/
public void setFontFamily(String fontFamily) {
COSString name = null;
if (fontFamily != null) {
name = new COSString(fontFamily);
}
dic.setItem(COSName.FONT_FAMILY, name);
}
Aggregations