Hi Adam,
did you ever try to use one of the following methods:
COSArrayList.iterator
COSArrayList.listIterator
COSArrayList.toArray
All of them should return the data you're looking for.
Andreas Lehmkühler
Adam Nichols schrieb:
I propose the following function is added to COSArrayList.
public COSArray toList()
{
COSArray copy = new COSArray();
for(int i=0; i < array.size(); ++i)
copy.add(array.get(i));
return copy;
}
This returns a copy of the array to ensure the callers can't modify the
internal array variable. Callers already have access to this information
as it is the same data as is returned by toString() just in a more useful
format. If it's OK to give the callers the ability to modify array
directly, a reference could simply be returned.
I needed this because I got the "indirect reference to a page object" from
the target listed in a GoTo action and needed the page number. By using
the method above I was able to get the page references in the catalog and
thus was able to determine the page number based on the page object id I
had.