Search in sources :

Example 81 with COSDictionary

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

the class FDFPage method getTemplates.

/**
 * This will get a list of FDFTemplage objects that describe the named pages that serve as templates.
 *
 * @return A list of templates.
 */
public List<FDFTemplate> getTemplates() {
    List<FDFTemplate> retval = null;
    COSArray array = (COSArray) page.getDictionaryObject(COSName.TEMPLATES);
    if (array != null) {
        List<FDFTemplate> objects = new ArrayList<FDFTemplate>();
        for (int i = 0; i < array.size(); i++) {
            objects.add(new FDFTemplate((COSDictionary) array.getObject(i)));
        }
        retval = new COSArrayList<FDFTemplate>(objects, array);
    }
    return retval;
}
Also used : COSArray(com.tom_roush.pdfbox.cos.COSArray) COSDictionary(com.tom_roush.pdfbox.cos.COSDictionary) COSArrayList(com.tom_roush.pdfbox.pdmodel.common.COSArrayList) ArrayList(java.util.ArrayList)

Example 82 with COSDictionary

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

the class FDFCatalog method getFDF.

/**
 * This will get the FDF dictionary.
 *
 * @return The FDF dictionary.
 */
public FDFDictionary getFDF() {
    COSDictionary fdf = (COSDictionary) catalog.getDictionaryObject(COSName.FDF);
    FDFDictionary retval;
    if (fdf != null) {
        retval = new FDFDictionary(fdf);
    } else {
        retval = new FDFDictionary();
        setFDF(retval);
    }
    return retval;
}
Also used : COSDictionary(com.tom_roush.pdfbox.cos.COSDictionary)

Example 83 with COSDictionary

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

the class FDFCatalog method getSignature.

/**
 * This will get the signature or null if there is none.
 *
 * @return The signature.
 */
public PDSignature getSignature() {
    PDSignature signature = null;
    COSDictionary sig = (COSDictionary) catalog.getDictionaryObject(COSName.SIG);
    if (sig != null) {
        signature = new PDSignature(sig);
    }
    return signature;
}
Also used : COSDictionary(com.tom_roush.pdfbox.cos.COSDictionary) PDSignature(com.tom_roush.pdfbox.pdmodel.interactive.digitalsignature.PDSignature)

Example 84 with COSDictionary

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

the class FDFDictionary method getJavaScript.

/**
 * This will get the java script entry.
 *
 * @return The java script entry describing javascript commands.
 */
public FDFJavaScript getJavaScript() {
    FDFJavaScript fs = null;
    COSDictionary dic = (COSDictionary) fdf.getDictionaryObject(COSName.JAVA_SCRIPT);
    if (dic != null) {
        fs = new FDFJavaScript(dic);
    }
    return fs;
}
Also used : COSDictionary(com.tom_roush.pdfbox.cos.COSDictionary)

Example 85 with COSDictionary

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

the class FDFField method getAppearanceDictionary.

/**
 * This will get the appearance dictionary that specifies the appearance of a pushbutton field.
 *
 * @return The AP entry of this dictionary.
 */
public PDAppearanceDictionary getAppearanceDictionary() {
    PDAppearanceDictionary retval = null;
    COSDictionary dict = (COSDictionary) field.getDictionaryObject(COSName.AP);
    if (dict != null) {
        retval = new PDAppearanceDictionary(dict);
    }
    return retval;
}
Also used : PDAppearanceDictionary(com.tom_roush.pdfbox.pdmodel.interactive.annotation.PDAppearanceDictionary) 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