Search in sources :

Example 1 with PDThread

use of com.tom_roush.pdfbox.pdmodel.interactive.pagenavigation.PDThread in project PdfBox-Android by TomRoush.

the class PDDocumentCatalog method getThreads.

/**
 * Returns the document's article threads.
 *
 * @return a list containing all article threads.
 */
public List<PDThread> getThreads() {
    COSArray array = (COSArray) root.getDictionaryObject(COSName.THREADS);
    if (array == null) {
        array = new COSArray();
        root.setItem(COSName.THREADS, array);
    }
    List<PDThread> pdObjects = new ArrayList<PDThread>();
    for (int i = 0; i < array.size(); i++) {
        pdObjects.add(new PDThread((COSDictionary) array.getObject(i)));
    }
    return new COSArrayList<PDThread>(pdObjects, array);
}
Also used : COSArrayList(com.tom_roush.pdfbox.pdmodel.common.COSArrayList) COSArray(com.tom_roush.pdfbox.cos.COSArray) COSDictionary(com.tom_roush.pdfbox.cos.COSDictionary) PDThread(com.tom_roush.pdfbox.pdmodel.interactive.pagenavigation.PDThread) ArrayList(java.util.ArrayList) COSArrayList(com.tom_roush.pdfbox.pdmodel.common.COSArrayList)

Aggregations

COSArray (com.tom_roush.pdfbox.cos.COSArray)1 COSDictionary (com.tom_roush.pdfbox.cos.COSDictionary)1 COSArrayList (com.tom_roush.pdfbox.pdmodel.common.COSArrayList)1 PDThread (com.tom_roush.pdfbox.pdmodel.interactive.pagenavigation.PDThread)1 ArrayList (java.util.ArrayList)1