use of com.tom_roush.pdfbox.pdmodel.common.COSArrayList in project PdfBox-Android by TomRoush.
the class FDFDictionary method getPages.
/**
* This will get the list of FDF Pages. This will return a list of FDFPage objects.
*
* @return A list of FDF pages.
*/
public List<FDFPage> getPages() {
List<FDFPage> retval = null;
COSArray pageArray = (COSArray) fdf.getDictionaryObject(COSName.PAGES);
if (pageArray != null) {
List<FDFPage> pages = new ArrayList<FDFPage>();
for (int i = 0; i < pageArray.size(); i++) {
pages.add(new FDFPage((COSDictionary) pageArray.get(i)));
}
retval = new COSArrayList<FDFPage>(pages, pageArray);
}
return retval;
}
use of com.tom_roush.pdfbox.pdmodel.common.COSArrayList in project PdfBox-Android by TomRoush.
the class FDFField method getOptions.
/**
* This will return a list of options for a choice field. The value in the list will be 1 of 2 types.
* java.lang.String or FDFOptionElement.
*
* @return A list of all options.
*/
public List<Object> getOptions() {
List<Object> retval = null;
COSArray array = (COSArray) field.getDictionaryObject(COSName.OPT);
if (array != null) {
List<Object> objects = new ArrayList<Object>();
for (int i = 0; i < array.size(); i++) {
COSBase next = array.getObject(i);
if (next instanceof COSString) {
objects.add(((COSString) next).getString());
} else {
COSArray value = (COSArray) next;
objects.add(new FDFOptionElement(value));
}
}
retval = new COSArrayList<Object>(objects, array);
}
return retval;
}
use of com.tom_roush.pdfbox.pdmodel.common.COSArrayList in project PdfBox-Android by TomRoush.
the class FDFTemplate method getFields.
/**
* This will get a list of fields that are part of this template.
*
* @return A list of fields.
*/
public List<FDFField> getFields() {
List<FDFField> retval = null;
COSArray array = (COSArray) template.getDictionaryObject(COSName.FIELDS);
if (array != null) {
List<FDFField> fields = new ArrayList<FDFField>();
for (int i = 0; i < array.size(); i++) {
fields.add(new FDFField((COSDictionary) array.getObject(i)));
}
retval = new COSArrayList<FDFField>(fields, array);
}
return retval;
}
Aggregations