code: protected PdfDictionary copyDictionary(PdfDictionary in)
      throws IOException, BadPdfFormatException {
          PdfDictionary out = new PdfDictionary();
          PdfObject type = PdfReader.getPdfObjectRelease(in.get(PdfName.TYPE));
          
          for (Iterator it = in.getKeys().iterator(); it.hasNext();) {
              PdfName key = (PdfName)it.next();
              PdfObject value = in.get(key);
              //	    System.out.println("Copy " + key);
              if (type != null && PdfName.PAGE.equals(type)) {
                  if (!key.equals(PdfName.B) && !key.equals(PdfName.PARENT))
                      out.put(key, copyObject(value));
              }
              else
                  out.put(key, copyObject(value));
          }
          return out;
      }
docs: Translate a PRDictionary to a PdfDictionary. Also translate all of the
  objects contained in it.