Example usage for com.itextpdf.text.pdf PdfName FILEATTACHMENT

List of usage examples for com.itextpdf.text.pdf PdfName FILEATTACHMENT

Introduction

In this page you can find the example usage for com.itextpdf.text.pdf PdfName FILEATTACHMENT.

Prototype

PdfName FILEATTACHMENT

To view the source code for com.itextpdf.text.pdf PdfName FILEATTACHMENT.

Click Source Link

Document

A name

Usage

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

License:Open Source License

private Set<PdfDictionary> getFileAttachmentsDictionaries(PdfReader reader) {
    Set<PdfDictionary> retSet = new NullSafeSet<PdfDictionary>();
    for (int k = 1; k <= reader.getNumberOfPages(); ++k) {
        PdfArray annots = reader.getPageN(k).getAsArray(PdfName.ANNOTS);
        if (annots != null) {
            for (PdfObject current : annots) {
                PdfDictionary annot = (PdfDictionary) PdfReader.getPdfObject(current);
                if (PdfName.FILEATTACHMENT.equals(annot.getAsName(PdfName.SUBTYPE))) {
                    retSet.add(annot.getAsDict(PdfName.FS));
                }// www  .ja  v a  2s . c o  m
            }
        }
    }
    return retSet;
}