docs: def getFrameDimensions(data, page_width, page_height):
      """Calculate dimensions of a frame
  
      Returns left, top, width and height of the frame in points.
      """
      box = data.get("-pdf-frame-box", [])
      if len(box) == 4:
          return [getSize(x) for x in box]
      top = getSize(data.get("top", 0))
      left = getSize(data.get("left", 0))
      bottom = getSize(data.get("bottom", 0))
      right = getSize(data.get("right", 0))
      if "height" in data:
          height = getSize(data["height"])
          if "top" in data:
              top = getSize(data["top"])
              bottom = page_height - (top + height)
          elif "bottom" in data:
              bottom = getSize(data["bottom"])
              top = page_height - (bottom + height)
      if "width" in data:
          width = getSize(data["width"])
          if "left" in data:
              left = getSize(data["left"])
              right = page_width - (left + width)
          elif "right" in data:
              right = getSize(data["right"])
              left = page_width - (right + width)
      top += getSize(data.get("margin-top", 0))
      left += getSize(data.get("margin-left", 0))
      bottom += getSize(data.get("margin-bottom", 0))
      right += getSize(data.get("margin-right", 0))
  
      width = page_width - (left + right)
      height = page_height - (top + bottom)
      return left, top, width, height