    paper.localToPagePoint(p)

Transform the point `p` defined in the local coordinate system to the page coordinate system.

    var rightMidPoint = element.getBBox().rightMiddle();
    var pagePoint1 = paper.localToPagePoint(rightMidPoint);
     // alternative method signature
    var pagePoint2 = paper.localToPagePoint(rightMidPoint.x, rightMidPoint.y);
    // Draw an HTML rectangle next to the element.
    var div = document.createElement('div');
    div.style.position = 'absolute';
    div.style.background = 'red';
    div.style.left = pagePoint1.x + 'px';
    div.style.top = pagePoint1.y + 'px';
    div.style.width = '40px';
    div.style.height = '40px';
    div.style.marginLeft = '10px';
    div.style.marginTop = '-20px';
    document.body.appendChild(div);