Example usage for com.itextpdf.text.pdf PdfNameTree readTree

List of usage examples for com.itextpdf.text.pdf PdfNameTree readTree

Introduction

In this page you can find the example usage for com.itextpdf.text.pdf PdfNameTree readTree.

Prototype

public static HashMap<String, PdfObject> readTree(PdfDictionary dic) 

Source Link

Usage

From source file:org.sejda.impl.itext5.component.PdfUnpacker.java

License:Open Source License

private Set<PdfDictionary> getEmbeddedFilesDictionaries(PdfReader reader) {
    Set<PdfDictionary> retSet = new NullSafeSet<PdfDictionary>();
    PdfDictionary catalog = reader.getCatalog();
    PdfDictionary names = catalog.getAsDict(PdfName.NAMES);
    if (names != null) {
        PdfDictionary embFiles = names.getAsDict(PdfName.EMBEDDEDFILES);
        if (embFiles != null) {
            HashMap<String, PdfObject> embMap = PdfNameTree.readTree(embFiles);
            for (PdfObject value : embMap.values()) {
                retSet.add((PdfDictionary) PdfReader.getPdfObject(value));
            }/*from   w  w w  . j a va 2 s . c  o m*/
        }
    }
    return retSet;
}