Package com.lowagie.text.pdf

Examples of com.lowagie.text.pdf.PdfObject


      }
      File dest = (File) getValue("destfile");

      // 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);
View Full Code Here


          .getPdfObject(catalog.get(PdfName.OUTLINES));
      if (rootOutlines != null) {
        DefaultMutableTreeNode outlinetree = new ObjectTreeNode(
            "Outlinetree " + rootOutlines);
        filenode.add(outlinetree);
        PdfObject firstindref = rootOutlines.get(PdfName.FIRST);
        if (firstindref != null) {
          PdfDictionary first = (PdfDictionary) PdfReader
              .getPdfObject(firstindref);
          if (first != null) {
            iterateOutlines(first, reader, outlinetree);
View Full Code Here

      } 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) {
          iterateObjects(dest, pdfreader, leaf);
        }
        PdfObject a = PdfReader.getPdfObject(kid.get(PdfName.A));
        if (a != null) {
          iterateObjects(a, pdfreader, leaf);
        }
      }
    } while ((kid = (PdfDictionary) PdfReader.getPdfObject(kid.get(PdfName.NEXT))) != null);
View Full Code Here

      int i = 0;
      while (it.hasNext()) {
        i++;
        Object obj = it.next();

        PdfObject value = PdfReader
            .getPdfObject(((PdfDictionary) pdfobj)
                .get((PdfName) obj));
        // System.out.println("Value:" + value);
        ObjectTreeNode sttn = new ObjectTreeNode(obj + " "  + value);
        leaf.add(sttn);
        if (obj.equals(PdfName.PARENT)) {
          continue;
        }
        if (value != null) {
          iterateObjects(value, pdfreader, sttn);
        }
      }
    } else if (pdfobj.isArray()) {
      leaf = new ArrayTreeNode("PdfArray " + pdfobj, (PdfArray) pdfobj);
      node.add(leaf);
      ArrayList kids = ((PdfArray) pdfobj).getArrayList();
      for (int k = 0; k < kids.size(); ++k) {
        PdfObject curkid = (PdfObject) kids.get(k);
        if (curkid.isIndirect()) {
          PdfObject kid = PdfReader
              .getPdfObject((PRIndirectReference) kids.get(k));
          if (kid != null) {
            iterateObjects(kid, pdfreader, leaf);
          }
        } else if (curkid.isNumber()) {

        } else {
          PdfObject kid = (PdfObject) kids.get(k);
          iterateObjects(kid, pdfreader, leaf);
        }
      }
    } else if (pdfobj.isIndirect()) {
      leaf = new ObjectTreeNode("PRIndirectReference " + pdfobj);
      node.add(leaf);
      PdfObject target = PdfReader
          .getPdfObject(pdfobj);
      if (target != null) {
        iterateObjects(target, pdfreader, leaf);
      }
    } else if (pdfobj.isBoolean()) {
      // not shown
    } else if (pdfobj.isName()) {
      // not shown
    } else if (pdfobj.isNull()) {
      // not shown
    } else if (pdfobj.isNumber()) {
      // not shown
    } else if (pdfobj.isString()) {
      // not shown
    } else if (pdfobj.isStream()) {
      leaf = new StreamTreeNode(pdfobj, "Stream");
      node.add(leaf);
      leaf = new DictionaryTreeNode("PdfDictionary " + pdfobj,
          (PdfDictionary) pdfobj);
      node.add(leaf);
      Set s = ((PdfDictionary) pdfobj).getKeys();
      Iterator it = s.iterator();
      int i = 0;
      while (it.hasNext()) {
        i++;
        Object obj = it.next();

        PdfObject value = PdfReader
            .getPdfObject(((PdfDictionary) pdfobj)
                .get((PdfName) obj));
        // System.out.println("Value:" + value);
        ObjectTreeNode sttn = new ObjectTreeNode(obj + " "
            + value);
View Full Code Here

    public Object getValueAt(int rowIndex, int columnIndex) {
    switch (columnIndex) {
    case 0:
      return new Integer(rowIndex + 1);
    case 1:
      PdfObject object = reader.getPdfObject(rowIndex + 1);
      if (object != null && object.isStream()) {
        return "Stream " + object;
      } else {
        return object;
      }
    default:
View Full Code Here

        public Object construct() {
          try {
            PdfReader reader = new PdfReader(
                ((File) getValue("srcfile")).getAbsolutePath());
            for (int i = 0; i < reader.getXrefSize(); i++) {
              PdfObject pdfobj = reader.getPdfObject(i);
              if (pdfobj != null) {
                if (pdfobj.isStream()) {
                  PdfStream pdfdict = (PdfStream) pdfobj;
                  PdfObject pdfsubtype = pdfdict
                      .get(PdfName.SUBTYPE);
                  if (pdfsubtype == null) {
                    continue;
                  }
                  if (!pdfsubtype.toString().equals(
                      PdfName.IMAGE.toString())) {
                    continue;
                  }
                  System.out.println("total_number_of_pictures: "
                      + total_number_of_pictures);
View Full Code Here

                        PdfObject tuValue = dict.get(new PdfName("/TU"));
                        annotation = tuValue.toString();
                    }
                    */

                    PdfObject typeValue = null;
                    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;
View Full Code Here

                        PdfObject tuValue = dict.get(new PdfName("/TU"));
                        annotation = tuValue.toString();
                    }
                    */

                    PdfObject typeValue = null;
                    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;
View Full Code Here

                        PdfObject tuValue = dict.get(new PdfName("/TU"));
                        annotation = tuValue.toString();
                    }
                    */
                   
                    PdfObject typeValue = null;
                    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;
View Full Code Here

                dic.put(PdfName.GAMMA, new PdfNumber(gamma));
                dic.put(PdfName.WHITEPOINT, new PdfLiteral("[1 1 1]"));
                array.add(dic);
            }
            else {
                PdfObject wp = new PdfLiteral("[1 1 1]");
                array.add(PdfName.CALRGB);
                if (gamma != 1f) {
                    PdfArray gm = new PdfArray();
                    PdfNumber n = new PdfNumber(gamma);
                    gm.add(n);
View Full Code Here

TOP

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

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.