code: protected PdfIndirectReference copyIndirect(PRIndirectReference in) throws IOException, BadPdfFormatException {
          PdfIndirectReference theRef;
          RefKey key = new RefKey(in);
          IndirectReferences iRef = (IndirectReferences)indirects.get(key);
          if (iRef != null) {
              theRef = iRef.getRef();
              if (iRef.getCopied()) {
                  return theRef;
              }
          }
          else {
              theRef = body.getPdfIndirectReference();
              iRef = new IndirectReferences(theRef);
              indirects.put(key, iRef);
          }
          PdfObject obj = PdfReader.getPdfObjectRelease(in);
          if (obj != null && obj.isDictionary()) {
              PdfObject type = PdfReader.getPdfObjectRelease(((PdfDictionary)obj).get(PdfName.TYPE));
              if (type != null && PdfName.PAGE.equals(type)) {
                  return theRef;
              }
          }
          iRef.setCopied();
          obj = copyObject(obj);
          addToBody(obj, theRef);
          return theRef;
      }
docs: Translate a PRIndirectReference to a PdfIndirectReference
  In addition, translates the object numbers, and copies the
  referenced object to the output file.
  NB: PRIndirectReferences (and PRIndirectObjects) really need to know what
  file they came from, because each file has its own namespace. The translation
  we do from their namespace to ours is *at best* heuristic, and guaranteed to
  fail under some circumstances.