code: function handleDocumentMouseup(e) {
    let svg;
    if (lines.length > 1 && (svg = findSVGAtPoint(e.clientX, e.clientY))) {
      let { documentId, pageNumber } = getMetadata(svg);
  
      PDFJSAnnotate.getStoreAdapter().addAnnotation(documentId, pageNumber, {
          type: 'drawing',
          width: _penSize,
          color: _penColor,
          lines
        }
      ).then((annotation) => {
        if (path) {
          svg.removeChild(path);
        }
  
        appendChild(svg, annotation);
      });
    }
  
    document.removeEventListener('mousemove', handleDocumentMousemove);
    document.removeEventListener('mouseup', handleDocumentMouseup);
  }
docs: Handle document.mouseup event
  
  @param {Event} e The DOM event to be handled