Exemplo n.º 1
0
  public void setDictionary(int id, PdfObject value) {

    value.setID(id);

    switch (id) {
      case PdfDictionary.Encrypt:
        Encrypt = value;
        break;

      case PdfDictionary.Extends:
        Extends = value;
        break;

      case PdfDictionary.Info:
        Info = value;
        break;

      case PdfDictionary.Root:
        Root = value;
        break;

        //            case PdfDictionary.XObject:
        //            	XObject=value;
        //    		break;

      default:
        super.setDictionary(id, value);
    }
  }
  @Override
  public void setDictionary(final int id, final PdfObject value) {

    value.setID(id);

    switch (id) {
      case PdfDictionary.TR:
        TR = value;
        break;

      default:
        super.setDictionary(id, value);
    }
  }
  public void checkParentForResources(final PdfObject pdfObject) {

    /** if no resource, check parent for one (in theory should recurse up whole tree) */
    if (pdfObject.getDictionary(PdfDictionary.Resources) == null) {

      final String parent = pdfObject.getStringKey(PdfDictionary.Parent);

      if (parent != null) {
        final PdfObject parentObj = new PageObject(parent);
        readObject(parentObj);

        final PdfObject resObj = parentObj.getDictionary(PdfDictionary.Resources);

        if (resObj != null) {
          pdfObject.setDictionary(PdfDictionary.Resources, resObj);
        }
      }
    }
  }