Package com.lowagie.text.pdf

Examples of com.lowagie.text.pdf.PdfObject


        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)
              continue;
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

  public FormTreeNode(PdfObjectTreeNode node) {
    super("form.png");
    this.object_node = node;
    if (node.isDictionary()) {
      PdfDictionary dict = (PdfDictionary)node.getPdfObject();
      PdfObject fieldname = dict.get(PdfName.T);
      if (fieldname != null) {
        this.setUserObject(fieldname);
      }
      else {
        this.setUserObject("unnamed field");
View Full Code Here

      }
      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

   * @return  a caption for the object corresponding with the key in the dictionary.
   */
  public static String getDictionaryEntryCaption(PdfDictionary dict, PdfName key) {
    StringBuffer buf = new StringBuffer(key.toString());
    buf.append(": ");
        PdfObject valObj = dict.get(key);
        if (valObj.isIndirect()) {
            buf.append( getCaption( valObj ) );
        } else {
            buf.append(dict.get(key).toString());
        }
        return buf.toString();
View Full Code Here

        StringBuffer builder = new StringBuffer();
        builder.append('(');
        List subDictionaries = new ArrayList();
        for (Iterator i = dic.getKeys().iterator(); i.hasNext(); ) {
            PdfName key = (PdfName)i.next();
            PdfObject val = dic.getDirectObject(key);
            if (val.isDictionary())
                subDictionaries.add(key);
            builder.append(key);
            builder.append('=');
            builder.append(val);
            builder.append(", ");
View Full Code Here

    public static Image getInstance(PRIndirectReference ref) throws BadElementException {
        PdfDictionary dic = (PdfDictionary)PdfReader.getPdfObjectRelease(ref);
        int width = ((PdfNumber)PdfReader.getPdfObjectRelease(dic.get(PdfName.WIDTH))).intValue();
        int height = ((PdfNumber)PdfReader.getPdfObjectRelease(dic.get(PdfName.HEIGHT))).intValue();
        Image imask = null;
        PdfObject obj = dic.get(PdfName.SMASK);
        if (obj != null && obj.isIndirect()) {
            imask = getInstance((PRIndirectReference)obj);
        }
        else {
            obj = dic.get(PdfName.MASK);
            if (obj != null && obj.isIndirect()) {
                PdfObject obj2 = PdfReader.getPdfObjectRelease(obj);
                if (obj2 instanceof PdfDictionary)
                    imask = getInstance((PRIndirectReference)obj);
            }
        }
        Image img = new ImgRaw(width, height, 1, 1, null);
View Full Code Here

        if (additional == null)
            return;
        PdfArray value = additional.getAsArray(PdfName.COLORSPACE);
        if (value == null)
            return;
        PdfObject cs = simplifyColorspace(value);
        PdfObject newValue;
        if (cs.isName())
            newValue = cs;
        else {
            newValue = value;
            PdfName first = value.getAsName(0);
View Full Code Here

   * @return  false if there are no objects left to check.
   */
  public boolean storeNextObject() {
    while (current < n) {
      current++;
      PdfObject object = reader.getPdfObjectRelease(current);
      if (object != null) {
        int idx = size();
        idxToRef.put(idx, current);
        refToIdx.put(current, idx);
        store(object);
View Full Code Here

   * Loads an object based on its reference number in the xref table.
   * @param ref  a reference number in the xref table.
   * @return  a PDF object
   */
  public PdfObject loadObjectByReference(int ref) {
    PdfObject object = getObjectByReference(ref);
    if (object instanceof PdfNull) {
      int idx = getIndexByRef(ref);
      object = reader.getPdfObject(ref);
      objects.set(idx, object);
    }
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.