Package com.lowagie.text.pdf

Examples of com.lowagie.text.pdf.PdfName


      node.add(leaf);
      PdfDictionary first = (PdfDictionary) PdfReader.getPdfObject(kid.get(PdfName.FIRST));
      if (first != null) {
        iterateOutlines(first, pdfreader, leaf);
      } else {
        PdfDictionary se = (PdfDictionary) PdfReader.getPdfObject(kid.get(new PdfName("SE")));
        if (se != null) {
          iterateObjects(se, pdfreader, leaf);
        }
        PdfObject dest = PdfReader.getPdfObject(kid.get(PdfName.DEST));
        if (dest != null) {
View Full Code Here


      PdfDictionary catalog = reader.getCatalog();
      PdfDictionary names = (PdfDictionary) PdfReader
          .getPdfObject(catalog.get(PdfName.NAMES));
      if (names != null) {
        PdfDictionary embFiles = (PdfDictionary) PdfReader
            .getPdfObject(names.get(new PdfName("EmbeddedFiles")));
        if (embFiles != null) {
          HashMap embMap = PdfNameTree.readTree(embFiles);
          for (Iterator i = embMap.values().iterator(); i.hasNext();) {
            PdfDictionary filespec = (PdfDictionary) PdfReader
                .getPdfObject((PdfObject) i.next());
            unpackFile(reader, filespec, outPath);
          }
        }
      }
      for (int k = 1; k <= reader.getNumberOfPages(); ++k) {
        PdfArray annots = (PdfArray) PdfReader.getPdfObject(reader
            .getPageN(k).get(PdfName.ANNOTS));
        if (annots == null)
          continue;
        for (Iterator i = annots.listIterator(); i.hasNext();) {
          PdfDictionary annot = (PdfDictionary) PdfReader
              .getPdfObject((PdfObject) i.next());
          PdfName subType = (PdfName) PdfReader.getPdfObject(annot
              .get(PdfName.SUBTYPE));
          if (!PdfName.FILEATTACHMENT.equals(subType))
            continue;
          PdfDictionary filespec = (PdfDictionary) PdfReader
              .getPdfObject(annot.get(PdfName.FS));
View Full Code Here

   */
  public static void unpackFile(PdfReader reader, PdfDictionary filespec,
      String outPath) throws IOException {
    if (filespec == null)
      return;
    PdfName type = (PdfName) PdfReader.getPdfObject(filespec
        .get(PdfName.TYPE));
    if (!PdfName.F.equals(type) && !PdfName.FILESPEC.equals(type))
      return;
    PdfDictionary ef = (PdfDictionary) PdfReader.getPdfObject(filespec
        .get(PdfName.EF));
View Full Code Here

                    PdfObject tuValue = null;

                    Set dictKeys = dict.getKeys();
                    Iterator dictKeyIter = dictKeys.iterator();
                    while (dictKeyIter.hasNext()) {
                        PdfName dictKeyName = (PdfName) dictKeyIter.next();
                        PdfObject dictObject = dict.get(dictKeyName);

                        if ("/Type".equals(dictKeyName.toString())) {
                            typeValue = dictObject;
                        } else if ("/TU".equals(dictKeyName.toString())) {
                            tuValue = dictObject;
                        }
                        //Debug.logInfo("AcroForm widget fieldName[" + fieldName + "] dictKey[" + dictKeyName.toString() + "] dictValue[" + dictObject.toString() + "]", module);
                    }
                    if (tuValue != null && typeValue != null && "/Annot".equals(typeValue.toString())) {
View Full Code Here

                    PdfObject tuValue = null;

                    Set dictKeys = dict.getKeys();
                    Iterator dictKeyIter = dictKeys.iterator();
                    while (dictKeyIter.hasNext()) {
                        PdfName dictKeyName = (PdfName) dictKeyIter.next();
                        PdfObject dictObject = dict.get(dictKeyName);

                        if ("/Type".equals(dictKeyName.toString())) {
                            typeValue = dictObject;
                        } else if ("/TU".equals(dictKeyName.toString())) {
                            tuValue = dictObject;
                        }
                        //Debug.logInfo("AcroForm widget fieldName[" + fieldName + "] dictKey[" + dictKeyName.toString() + "] dictValue[" + dictObject.toString() + "]", module);
                    }
                    if (tuValue != null && typeValue != null && "/Annot".equals(typeValue.toString())) {
View Full Code Here

                    PdfObject tuValue = null;
                   
                    Set dictKeys = dict.getKeys();
                    Iterator dictKeyIter = dictKeys.iterator();
                    while (dictKeyIter.hasNext()) {
                        PdfName dictKeyName = (PdfName) dictKeyIter.next();
                        PdfObject dictObject = dict.get(dictKeyName);
                       
                        if ("/Type".equals(dictKeyName.toString())) {
                            typeValue = dictObject;
                        } else if ("/TU".equals(dictKeyName.toString())) {
                            tuValue = dictObject;
                        }
                        //Debug.logInfo("AcroForm widget fieldName[" + fieldName + "] dictKey[" + dictKeyName.toString() + "] dictValue[" + dictObject.toString() + "]", module);
                    }
                    if (tuValue != null && typeValue != null && "/Annot".equals(typeValue.toString())) {
View Full Code Here

        this(os);
        if (info != null) {
          DublinCoreSchema dc = new DublinCoreSchema();
          PdfSchema p = new PdfSchema();
          XmpBasicSchema basic = new XmpBasicSchema();
          PdfName key;
          PdfObject obj;
          for (Iterator it = info.getKeys().iterator(); it.hasNext();) {
            key = (PdfName)it.next();
            obj = info.get(key);
            if (obj == null)
View Full Code Here

        outPath = "";
      }
      PdfDictionary catalog = reader.getCatalog();
      PdfDictionary names = catalog.getAsDict(PdfName.NAMES);
      if (names != null) {
        PdfDictionary embFiles = names.getAsDict(new PdfName("EmbeddedFiles"));
        if (embFiles != null) {
            HashMap<String, PdfObject> embMap = PdfNameTree.readTree(embFiles);
          for (Iterator<PdfObject> i = embMap.values().iterator(); i.hasNext();) {
            PdfDictionary filespec = (PdfDictionary) PdfReader
                .getPdfObject(i.next());
            unpackFile(reader, filespec, outPath);
          }
        }
      }
      for (int k = 1; k <= reader.getNumberOfPages(); ++k) {
        PdfArray annots = reader.getPageN(k).getAsArray(PdfName.ANNOTS);
        if (annots == null)
          continue;
        for (Iterator<PdfObject> i = annots.listIterator(); i.hasNext();) {
          PdfDictionary annot = (PdfDictionary) PdfReader
              .getPdfObject(i.next());
          PdfName subType = annot.getAsName(PdfName.SUBTYPE);
          if (!PdfName.FILEATTACHMENT.equals(subType))
            continue;
          PdfDictionary filespec = annot.getAsDict(PdfName.FS);
          unpackFile(reader, filespec, outPath);
        }
View Full Code Here

   */
  public static void unpackFile(PdfReader reader, PdfDictionary filespec,
      String outPath) throws IOException {
    if (filespec == null)
      return;
    PdfName type = filespec.getAsName(PdfName.TYPE);
    if (!PdfName.F.equals(type) && !PdfName.FILESPEC.equals(type))
      return;
    PdfDictionary ef =filespec.getAsDict(PdfName.EF);
    if (ef == null)
      return;
View Full Code Here

      // we create a reader for a certain document
      PdfReader reader = new PdfReader(src.getAbsolutePath());
      PdfObject o;
      PdfDictionary d;
      PdfDictionary l;
      PdfName n;
      for (int i = 1; i < reader.getXrefSize(); i++) {
        o = reader.getPdfObject(i);
        if (o instanceof PdfDictionary) {
          d = (PdfDictionary)o;
          o = d.get(PdfName.A);
View Full Code Here

TOP

Related Classes of com.lowagie.text.pdf.PdfName

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.