collectObjects(pageRef) {
    if (!this.root || !this.rootDict || !(pageRef instanceof Ref)) {
      return null;
    }

    const parentTree = this.rootDict.get("ParentTree");
    if (!parentTree) {
      return null;
    }
    const ids = this.root.structParentIds?.get(pageRef);
    if (!ids) {
      return null;
    }

    const map = new Map();
    const numberTree = new NumberTree(parentTree, this.xref);

    for (const [elemId] of ids) {
      const obj = numberTree.getRaw(elemId);
      if (obj instanceof Ref) {
        map.set(elemId, obj);
      }
    }
    return map;
  }
Collect all the objects (i.e. tag) that are part of the page and return a
map of the structure element id to the object reference.
@param {Ref} pageRef
@returns {Map<number, Ref>}