*
* @throws IOException If there is an error while creating the annotations.
*/
public List getAnnotations() throws IOException
{
COSArrayList retval = null;
COSArray annots = (COSArray)page.getDictionaryObject(COSName.ANNOTS);
if (annots == null)
{
annots = new COSArray();
page.setItem(COSName.ANNOTS, annots);
retval = new COSArrayList(new ArrayList(), annots);
}
else
{
List actuals = new ArrayList();
for (int i=0; i < annots.size(); i++)
{
COSBase item = annots.getObject(i);
actuals.add( PDAnnotation.createAnnotation( item ) );
}
retval = new COSArrayList(actuals, annots);
}
return retval;
}