Search in sources :

Example 31 with COSDictionary

use of com.tom_roush.pdfbox.cos.COSDictionary in project PdfBox-Android by TomRoush.

the class PDPropBuild method getApp.

/**
 * A build data dictionary for the viewing application software
 * module that was used to create the parent signature.
 *
 * @return the App as PDPropBuildApp object
 */
public PDPropBuildDataDict getApp() {
    PDPropBuildDataDict app = null;
    COSDictionary appDic = dictionary.getCOSDictionary(COSName.APP);
    if (appDic != null) {
        app = new PDPropBuildDataDict(appDic);
    }
    return app;
}
Also used : COSDictionary(com.tom_roush.pdfbox.cos.COSDictionary)

Example 32 with COSDictionary

use of com.tom_roush.pdfbox.cos.COSDictionary in project PdfBox-Android by TomRoush.

the class PDPropBuild method getFilter.

/**
 * A build data dictionary for the signature handler that was
 * used to create the parent signature.
 *
 * @return the Filter as PDPropBuildFilter object
 */
public PDPropBuildDataDict getFilter() {
    PDPropBuildDataDict filter = null;
    COSDictionary filterDic = dictionary.getCOSDictionary(COSName.FILTER);
    if (filterDic != null) {
        filter = new PDPropBuildDataDict(filterDic);
    }
    return filter;
}
Also used : COSDictionary(com.tom_roush.pdfbox.cos.COSDictionary)

Example 33 with COSDictionary

use of com.tom_roush.pdfbox.cos.COSDictionary in project PdfBox-Android by TomRoush.

the class PDSeedValueCertificate method getSubjectDN.

/**
 * Returns list of maps that contains subject distinguished names like [(cn: John Doe, o: Doe), (cn: John Smith)]
 * both keys are typically of the form 'cn', 'o', 'email', '2.5.4.43'; and values are text strings.
 *
 * @return a list of maps containing the subject distinguished names
 */
public List<Map<String, String>> getSubjectDN() {
    COSBase base = this.dictionary.getDictionaryObject(COSName.SUBJECT_DN);
    if (base instanceof COSArray) {
        COSArray cosArray = (COSArray) base;
        List subjectDNList = cosArray.toList();
        List<Map<String, String>> result = new LinkedList<Map<String, String>>();
        for (Object subjectDNItem : subjectDNList) {
            if (subjectDNItem instanceof COSDictionary) {
                COSDictionary subjectDNItemDict = (COSDictionary) subjectDNItem;
                Map<String, String> subjectDNMap = new HashMap<String, String>();
                for (COSName key : subjectDNItemDict.keySet()) {
                    subjectDNMap.put(key.getName(), subjectDNItemDict.getString(key));
                }
                result.add(subjectDNMap);
            }
        }
        return result;
    }
    return null;
}
Also used : COSArray(com.tom_roush.pdfbox.cos.COSArray) COSDictionary(com.tom_roush.pdfbox.cos.COSDictionary) COSName(com.tom_roush.pdfbox.cos.COSName) HashMap(java.util.HashMap) COSBase(com.tom_roush.pdfbox.cos.COSBase) List(java.util.List) COSArrayList(com.tom_roush.pdfbox.pdmodel.common.COSArrayList) LinkedList(java.util.LinkedList) COSString(com.tom_roush.pdfbox.cos.COSString) Map(java.util.Map) HashMap(java.util.HashMap) LinkedList(java.util.LinkedList)

Example 34 with COSDictionary

use of com.tom_roush.pdfbox.cos.COSDictionary in project PdfBox-Android by TomRoush.

the class PDSignature method getPropBuild.

/**
 * PDF signature build dictionary. Provides information about the signature handler.
 *
 * @return the pdf signature build dictionary.
 */
public PDPropBuild getPropBuild() {
    PDPropBuild propBuild = null;
    COSDictionary propBuildDic = dictionary.getCOSDictionary(COSName.PROP_BUILD);
    if (propBuildDic != null) {
        propBuild = new PDPropBuild(propBuildDic);
    }
    return propBuild;
}
Also used : COSDictionary(com.tom_roush.pdfbox.cos.COSDictionary)

Example 35 with COSDictionary

use of com.tom_roush.pdfbox.cos.COSDictionary in project PdfBox-Android by TomRoush.

the class PDAnnotationAdditionalActions method getU.

/**
 * This will get an action to be performed when the mouse button
 * is released inside the annotation's active area.
 * The name U stands for "up".
 *
 * @return The U entry of annotation's additional actions dictionary.
 */
public PDAction getU() {
    COSDictionary u = (COSDictionary) actions.getDictionaryObject("U");
    PDAction retval = null;
    if (u != null) {
        retval = PDActionFactory.createAction(u);
    }
    return retval;
}
Also used : COSDictionary(com.tom_roush.pdfbox.cos.COSDictionary)

Aggregations

COSDictionary (com.tom_roush.pdfbox.cos.COSDictionary)221 COSArray (com.tom_roush.pdfbox.cos.COSArray)68 COSBase (com.tom_roush.pdfbox.cos.COSBase)68 IOException (java.io.IOException)25 ArrayList (java.util.ArrayList)24 COSName (com.tom_roush.pdfbox.cos.COSName)23 COSObject (com.tom_roush.pdfbox.cos.COSObject)22 COSArrayList (com.tom_roush.pdfbox.pdmodel.common.COSArrayList)15 HashMap (java.util.HashMap)14 COSStream (com.tom_roush.pdfbox.cos.COSStream)13 Map (java.util.Map)12 PDPage (com.tom_roush.pdfbox.pdmodel.PDPage)10 COSString (com.tom_roush.pdfbox.cos.COSString)7 PDDocument (com.tom_roush.pdfbox.pdmodel.PDDocument)6 PDResources (com.tom_roush.pdfbox.pdmodel.PDResources)6 ByteArrayOutputStream (java.io.ByteArrayOutputStream)6 List (java.util.List)6 ByteArrayInputStream (java.io.ByteArrayInputStream)5 File (java.io.File)5 Test (org.junit.Test)5